1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
|
.\" $Id$
.\"
.\" manpage written by jose@monkey.org
.\"
.Dd 21 March, 2008
.Dt DNSTOP 8
.Os
.Sh NAME
.Nm dnstop
.Nd displays various tables of DNS traffic on your network
.Sh SYNOPSIS
.Nm
.Op Fl 46apsQR
.Op Fl b Ar expression
.Op Fl i Ar address
.Op Fl f Ar filter
.Op Fl r Ar interval
.Op Ar device
.Op Ar savefile
.Sh DESCRIPTION
.Nm
is a small tool to listen on
.Ar device
or to parse the file
.Ar savefile
and collect and print statistics on the local network's DNS traffic. You
must have read access to
.Pa /dev/bpf\&* .
.Sh COMMAND LINE OPTIONS
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl 4
count only messages with IPv4 addresses
.It Fl 6
count only messages with IPv6 addresses
.It Fl Q
count only DNS query messages
.It Fl R
count only DNS reply messages
.It Fl a
anonymize addresses
.It Fl b Ar expression
BPF filter expression
.br
(default: udp port 53)
.It Fl i Ar address
ignore select addresses
.It Fl p
Do not put the interface into promiscuous mode.
.It Fl r
Redraw interval (seconds).
.It Fl l Ar level
keep counts on names up to
.Pa level
domain name levels.
.Pp
For example, with -l 2 (the default),
.Nm
will keep two tables: one with top-level domain names, and another
with second-level domain names. Increasing the
.Pa level
provides more details, but also requires more memory and CPU.
.\"
.It Fl f
input filter name
.Pp
The "unknown-tlds" filter
includes only queries for TLDs that are
bogus. Useful for identifying hosts/servers
that leak queries for things like "localhost"
or "workgroup."
.Pp
The "new-gtlds" filter 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.
.Pp
The "A-for-A" filter
includes only A queries for names that are
already IP addresses. Certain Microsoft
Windows DNS servers have a known bug that
forward these queries.
.Pp
The "rfc1918-ptr" filter
includes only PTR queries for addresses in RFC1918 space.
These should never leak from inside an
organization.
.Pp
The "refused" filter, when used with the
.Fl R
option, tells
.Nm
to count only replies with rcode REFUSED.
.Pp
The "servfail" filter, when used with the
.Fl R
option, tells
.Nm
to count only replies with rcode SERVFAIL.
.Pp
The "nxdomain" filter, when used with the
.Fl R
option, tells
.Nm
to count only replies with rcode NXDOMAIN.
.Pp
The "qtype-any" filter tells
.Nm
to count only message of type ANY.
.\"
.It Fl n Ar name
Only count messages within the domain
.Ar name
.It Fl P
Print "progress" messages on stderr when in non-interactive mode.
.It Fl B Ar buckets
Use
.Pa buckets
hash table buckets.
.It Fl X
Do not tabulate the sources + query name counters. This can significantly
reduce memory usage on busy servers and large savefiles.
.It Ar savefile
a captured network trace in
.Cm pcap
format
.It Ar device
ethernet device (ie fxp0)
.El
.Sh RUN TIME OPTIONS
.Pp
While running, the following options are available to alter the display:
.Bl -tag -width Ds
.It s
display the source address table
.It d
display the destination address table
.It t
display the breakdown of query types seen
.It r
display the breakdown of response codes seen
.It o
display the breakdown of opcodes seen
.It 1
show 1st level query names
.It 2
show 2nd level query names
.It 3
show 3rd level query names
.It 4
show 4th level query names
.It 5
show 5th level query names
.It 6
show 6th level query names
.It 7
show 7th level query names
.It 8
show 8th level query names
.It 9
show 9th level query names
.It !
show sources + 1st level query names
.It @
show sources + 2nd level query names
.It #
show sources + 3rd level query names
.It $
show sources + 4th level query names
.It %
show sources + 5th level query names
.It ^
show sources + 6th level query names
.It &
show sources + 7th level query names
.It *
show sources + 8th level query names
.It (
show sources + 9th level query names
.It ^R
reset the counters
.It ^X
exit the program
.It space
redraw
.It ?
help
.El
.Pp
.Sh NON-INTERACTIVE MODE
If stdout is not a tty,
.Nm
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,
.Nm
prints the top 50 entries for each table.
.Pp
.Sh HOW MESSAGES ARE COUNTED
By default
.Nm
examines only query messages and ignores replies. In this case the response code
table is meaningless and will likely show 100% "Noerror."
.Pp
If you supply (only) the
.Fl R
command line option,
.Nm
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.
.Pp
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
.Fl R
and
.Fl 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.
.Pp
.Sh AUTHORS
.Bl -tag -width xx -compact
.It Pa Duane Wessels (wessels@measurement-factory.com)
.It Pa Mark Foster (mark@foster.cc)
.It Pa Jose Nazario (jose@monkey.org)
.It Pa Sam Norris <@ChangeIP.com>
.It Pa Max Horn <@quendi.de>
.It Pa John Morrissey <jwm@horde.net>
.It Pa Florian Forster <octo@verplant.org>
.It Pa Dave Plonka <plonka@cs.wisc.edu>
.It Pa http://dnstop.measurement-factory.com/
.El
.Sh BUGS
Does not support TCP at this time.
|