DNSTOP(8)

๐Ÿ“ฆ
version 2014-09 ยท 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, nixos 26.05, nixpkgs unstable

๐ŸŒธ DNSTOP(8) โ€” System Manager's Manual ๐ŸŒธ

okay so bestie, welcome to the dnstop(8) page: itโ€™s giving โ€œsmall tool, big DNS energy,โ€ and weโ€™re about to get into every single detail. ๐Ÿ’…

โœจ NAME โœจ

dnstop โ€” displays various tables of DNS traffic on your network

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

dnstop [-46apsQR] [-b expression] [-i address] [-f filter] [-r interval]
       [device] [savefile]

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

okay so dnstop is a small tool that listens on device or parses the file savefile, then collects and prints statistics on the local networkโ€™s DNS traffic. Itโ€™s literally that girl. โœจ

๐Ÿ” heads up, bestie: you must have read access to /dev/bpf*.

๐Ÿ› ๏ธ COMMAND LINE OPTIONS ๐Ÿ› ๏ธ

the options are as follows โ€” no skips, no cap:

  • -4 โ€” count only messages with IPv4 addresses
  • -6 โ€” count only messages with IPv6 addresses
  • -Q โ€” count only DNS query messages
  • -R โ€” count only DNS reply messages
  • -a โ€” anonymize addresses
  • -b expression โ€” BPF filter expression; default is udp port 53
  • -i address โ€” ignore select addresses
  • -p โ€” do not put the interface into promiscuous mode
  • -r โ€” redraw interval (seconds); the synopsis spells it as -r interval
  • -l level โ€” keep counts on names up to level domain name levels
    • for example, with -l 2 (the default), dnstop will keep two tables: one with top-level domain names, and another with second-level domain names. Increasing the level provides more details, but also requires more memory and CPU. ๐Ÿ’–
  • -f filter โ€” input filter name; hereโ€™s the filter menu, iykyk:
    • unknown-tlds โ€” includes only queries for TLDs that are bogus. Useful for identifying hosts/servers that leak queries for things like "localhost" or "workgroup."
    • new-gtlds โ€” includes only queries for the new gTLD program of 2013/2014. Useful for identifying hosts/servers that use names which may result in future collisions and problems when new gTLDs become active.
    • A-for-A โ€” includes only A queries for names that are already IP addresses. Certain Microsoft Windows DNS servers have a known bug that forward these queries.
    • rfc1918-ptr โ€” includes only PTR queries for addresses in RFC1918 space. These should never leak from inside an organization.
    • refused โ€” when used with the -R option, tells dnstop to count only replies with rcode REFUSED.
    • qtype-any โ€” tells dnstop to count only message of type ANY.
  • -n name โ€” only count messages within the domain name
  • -P โ€” print "progress" messages on stderr when in non-interactive mode
  • -B buckets โ€” use buckets hash table buckets
  • -X โ€” do not tabulate the sources + query name counters. This can significantly reduce memory usage on busy servers and large savefiles.
  • savefile โ€” a captured network trace in pcap format
  • device โ€” ethernet device (ie fxp0)

๐ŸŽฎ RUN TIME OPTIONS ๐ŸŽฎ

while itโ€™s running, these keys are your remote control, bestie:

  • s โ€” display the source address table
  • d โ€” display the destination address table
  • t โ€” display the breakdown of query types seen
  • r โ€” display the breakdown of response codes seen
  • o โ€” display the breakdown of opcodes seen
  • 1 โ€” show 1st level query names
  • 2 โ€” show 2nd level query names
  • 3 โ€” show 3rd level query names
  • 4 โ€” show 4th level query names
  • 5 โ€” show 5th level query names
  • 6 โ€” show 6th level query names
  • 7 โ€” show 7th level query names
  • 8 โ€” show 8th level query names
  • 9 โ€” show 9th level query names
  • ! โ€” show sources + 1st level query names
  • @ โ€” show sources + 2nd level query names
  • # โ€” show sources + 3rd level query names
  • $ โ€” show sources + 4th level query names
  • % โ€” show sources + 5th level query names
  • ^ โ€” show sources + 6th level query names
  • & โ€” show sources + 7th level query names
  • * โ€” show sources + 8th level query names
  • ( โ€” show sources + 9th level query names
  • ^R โ€” reset the counters
  • ^X โ€” exit the program
  • space โ€” redraw
  • ? โ€” help

๐ŸŒˆ NON-INTERACTIVE MODE ๐ŸŒˆ

if stdout is not a tty, dnstop runs in non-interactive mode. In this case, you must supply a savefile for reading, instead of capturing live packets. After reading the entire savefile, dnstop prints the top 50 entries for each table. periodt. ๐Ÿ’…

๐Ÿ” HOW MESSAGES ARE COUNTED ๐Ÿ”

by default, dnstop examines only query messages and ignores replies. In this case the response code table is meaningless and will likely show 100% "Noerror." ๐Ÿ˜ญ

if you supply (only) the -R command line option, dnstop examines replies and ignores queries. This allows you to see meaningful response code values, as well as all the other tables. In this case all the query attributes (such as type and name) are taken from the Question section of the reply. slay. โœจ

note, however, that it is common for a stream of DNS messages to contain more queries than replies. This could happen, for example, if the server is too busy to respond to every single query, or if the server is designed to ignore malformed query messages. Therefore, you might want to examine both queries and replies by giving both -R and -Q command line options. In this case, only the response code counts are taken from the replies and all other attributes are taken from the queries. fr fr. ๐Ÿซถ

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

shoutout to the icons who made this happen:

  • Duane Wessels (wessels@measurement-factory.com)
  • Mark Foster (mark@foster.cc)
  • Jose Nazario (jose@monkey.org)
  • Sam Norris (<@ChangeIP.com>)
  • Max Horn (<@quendi.de>)
  • John Morrissey (jwm@horde.net)
  • Florian Forster (octo@verplant.org)
  • Dave Plonka (plonka@cs.wisc.edu)
  • http://dnstop.measurement-factory.com/

๐Ÿ’€ BUGS ๐Ÿ’€

๐Ÿšจ BUGS vibe check: does not support TCP at this time. thatโ€™s the tea. ๐Ÿ’€
๐Ÿ’Œ cute sign-off: Debian, 21 March, 2008 โ€” source/version and date, periodt. ๐Ÿซถ
๐Ÿ“ฆ where this page comes from