• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

bin/H06-Feb-2021-13785

contrib/H03-May-2022-3,1542,384

dnsviz/H06-Feb-2021-22,81917,085

doc/H03-May-2022-3,4903,011

external/H06-Feb-2021-1713

share/H06-Feb-2021-126122

tests/H06-Feb-2021-2,5972,060

.gitignoreH A D06-Feb-202179 109

.travis.ymlH A D06-Feb-2021594 2928

COPYRIGHTH A D06-Feb-2021838 2115

DockerfileH A D06-Feb-2021412 1410

LICENSEH A D06-Feb-202117.7 KiB340281

MANIFEST-includejs.inH A D06-Feb-2021569 1918

MANIFEST.inH A D06-Feb-2021560 1918

README.mdH A D06-Feb-202116 KiB555414

setup.cfgH A D06-Feb-202180 86

setup.pyH A D03-May-20227 KiB163133

README.md

1# ![DNSViz](doc/images/logo-220x100.png)
2
3
4## Table of Contents
5* [Installation](#installation)
6* [Usage](#usage)
7* [Pre-Deployment DNS Testing](#pre-deployment-dns-testing)
8* [Docker Container](#docker-container)
9
10
11## Description
12
13DNSViz is a tool suite for analysis and visualization of Domain Name System
14(DNS) behavior, including its security extensions (DNSSEC).  This tool suite
15powers the Web-based analysis available at https://dnsviz.net/
16
17
18## Installation
19
20DNSViz packages are available in repositories for popular operating systems,
21such as Debian, Ubuntu, and FreeBSD.  DNSViz can also be installed on Mac OS X
22via Homebrew or MacPorts.
23
24The remainer of this section covers other methods of installation, including a
25list of [dependencies](#dependencies), installation to a
26[virtual environment](#installation-in-a-virtual-environment), and installation
27on [Fedora](#fedora-rpm-build-and-install) and
28[RHEL7](#rhel7-rpm-build-and-install).
29
30Instructions for running in a Docker container are also available
31[later in this document](#docker-container).
32
33
34### Dependencies
35
36* python (2.7, 3.5 - 3.9) - https://www.python.org/
37
38* dnspython (1.13.0 or later) - https://www.dnspython.org/
39
40* pygraphviz (1.3 or later) - https://pygraphviz.github.io/
41
42* M2Crypto (0.37.0 or later) - https://gitlab.com/m2crypto/m2crypto
43
44Note that earlier versions of the software listed above might also work with
45DNSViz, but with some caveats.  For example, M2Crypto 0.28.0 and later will
46work, but versions of M2Crypto earlier than 0.37.0 lack support for DNSSEC
47algorithms 15 (Ed25519) and 16 (Ed448).  Also, while DNSViz itself still works
48with python 2.7, some versions of its software dependencies have moved on:
49pygraphviz 1.6 and dnspython 2.0.0 dropped support for python 2.7.
50
51
52### Optional Software
53
54* OpenSSL GOST Engine - https://github.com/gost-engine/engine
55
56  With OpenSSL version 1.1.0 and later, the OpenSSL GOST Engine is necessary to
57  validate DNSSEC signatures with algorithm 12 (GOST R 34.10-2001) and create
58  digests of type 3 (GOST R 34.11-94).
59
60* ISC BIND - https://www.isc.org/bind/
61
62  When using DNSViz for [pre-deployment testing](#pre-deployment-dns-testing)
63  by specifying zone files and/or alternate delegation information on the
64  command line (i.e., with `-N`, `-x`, or `-D`), `named(8)` is invoked to serve
65  one or more zones.  ISC BIND is only needed in this case, and `named(8)` does
66  not need to be running (i.e., as a server).
67
68  Note that default AppArmor policies for Debian are known to cause issues when
69  invoking `named(8)` from DNSViz for pre-deployment testing.  Two solutions to
70  this problem are to either: 1) create a local policy for AppArmor that allows
71  `named(8)` to run with fewer restrictions; or 2) disable AppArmor completely.
72
73
74### Installation in a Virtual Environment
75
76To install DNSViz to a virtual environment, first create and activate a virtual
77environment, and install the dependencies:
78```
79$ virtualenv ~/myenv
80$ source ~/myenv/bin/activate
81(myenv) $ pip install -r requirements.txt
82```
83(Note that this installs the dependencies that are python packages, but some of
84these packages have non-python dependecies, such as Graphviz (required for
85pygraphviz) that are not installed automatically.)
86
87Next download and install DNSViz from the Python Package Index (PyPI):
88```
89(myenv) $ pip install dnsviz
90```
91or locally, from a downloaded or cloned copy of DNSViz:
92```
93(myenv) $ pip install .
94```
95
96
97### Fedora RPM Build and Install
98
99Install the tools for building an RPM, and set up the rpmbuild tree.
100```
101$ sudo dnf install rpm-build rpmdevtools python3-devel
102$ rpmdev-setuptree
103```
104
105From within the DNSViz source directory, create a source distribution tarball
106and copy it and the DNSViz spec file to the appropriate rpmbuild
107subdirectories.
108```
109$ python3 setup.py sdist
110$ cp dist/dnsviz-*.tar.gz ~/rpmbuild/SOURCES/
111$ cp contrib/dnsviz.spec ~/rpmbuild/SPECS/
112```
113
114Install dnspython, pygraphviz, and M2Crypto.
115```
116$ sudo dnf install python3-dns python3-pygraphviz python3-m2crypto
117```
118(Note that as of Fedora 33, the latest version of M2Crypto is 0.35.2.  If you
119would like support for DNSSEC algorithms 15 (Ed25519) and 16 (Ed448), you will
120need to install M2Crypto using `pip3`.  For example, see [installation to a
121virtual environment](#installation-in-a-virtual-environment).)
122
123Build and install the DNSViz RPM.
124```
125$ rpmbuild -ba rpmbuild/SPECS/dnsviz.spec
126$ sudo rpm -iv rpmbuild/RPMS/noarch/dnsviz-*-1.*.noarch.rpm
127```
128
129
130### RHEL7 RPM Build and Install
131
132Install pygraphviz, M2Crypto, and dnspython, after installing their build dependencies.
133```
134$ sudo yum install python3 gcc python3-devel graphviz-devel openssl-devel swig
135$ pip3 install --user pbr m2crypto pygraphviz dnspython
136```
137
138Install rpm-build tools, then build and install the DNSViz RPM.
139```
140$ sudo yum install rpm-build
141$ python3 setup.py bdist_rpm --install-script contrib/rpm-install.sh --distribution-name el7
142$ sudo rpm -iv dist/dnsviz-*-1.noarch.rpm
143```
144
145Note that a custom install script is used to properly install the DNSViz man
146pages.
147
148
149## Usage
150
151DNSViz is invoked using the `dnsviz` command-line utility.  `dnsviz` itself
152uses several subcommands: `probe`, `grok`, `graph`, `print`, and `query`.  See
153the man pages associated with each subcommand, in the form of
154"dnsviz-<subcommand> (1)" (e.g., "man dnsviz-probe") for more detailed
155documentation and usage.
156
157### dnsviz probe
158
159`dnsviz probe` takes one or more domain names as input and performs a series of
160queries to either recursive (default) or authoritative DNS servers, the results
161of which are serialized into JSON format.
162
163
164#### Examples
165
166Analyze the domain name example.com using your configured DNS resolvers (i.e.,
167in `/etc/resolv.conf`) and store the queries and responses in the file named
168"example.com.json":
169```
170$ dnsviz probe example.com > example.com.json
171```
172
173Same thing:
174```
175$ dnsviz probe -o example.com.json example.com
176```
177
178Analyze the domain name example.com by querying its authoritative servers
179directly:
180```
181$ dnsviz probe -A -o example.com.json example.com
182```
183
184Analyze the domain name example.com by querying explicitly-defined
185authoritative servers, rather than learning the servers through referrals from
186the IANA root servers:
187```
188$ dnsviz probe -A \
189  -x example.com:a.iana-servers.org=199.43.132.53,a.iana-servers.org=[2001:500:8c::53] \
190  -x example.com:b.iana-servers.org=199.43.133.53,b.iana-servers.org=[2001:500:8d::53] \
191  -o example.com.json example.com
192```
193
194Same, but have `dnsviz probe` resolve the names:
195```
196$ dnsviz probe -A \
197  -x example.com:a.iana-servers.org,b.iana-servers.org \
198  -o example.com.json example.com
199```
200
201Analyze the domain name example.com and its entire ancestry by querying
202authoritative servers and following delegations, starting at the root:
203```
204$ dnsviz probe -A -a . -o example.com.json example.com
205```
206
207Analyze multiple names in parallel (four threads) using explicit recursive
208resolvers (replace *192.0.1.2* and *2001:db8::1* with legitimate resolver
209addresses):
210```
211$ dnsviz probe -s 192.0.2.1,[2001:db8::1] -t 4 -o multiple.json \
212  example.com sandia.gov verisignlabs.com dnsviz.net
213```
214
215
216### dnsviz grok
217
218`dnsviz grok` takes serialized query results in JSON format (i.e., output from
219`dnsviz probe`) as input and assesses specified domain names based on their
220corresponding content in the input.  The output is also serialized into JSON
221format.
222
223
224#### Examples
225
226Process the query/response output produced by `dnsviz probe`, and store the
227serialized results in a file named "example.com-chk.json":
228```
229$ dnsviz grok < example.com.json > example.com-chk.json
230```
231
232Same thing:
233```
234$ dnsviz grok -r example.com.json -o example.com-chk.json example.com
235```
236
237Show only info-level information: descriptions, statuses, warnings, and errors:
238```
239$ dnsviz grok -l info -r example.com.json -o example.com-chk.json
240```
241
242Show descriptions only if there are related warnings or errors:
243```
244$ dnsviz grok -l warning -r example.com.json -o example.com-chk.json
245```
246
247Show descriptions only if there are related errors:
248```
249$ dnsviz grok -l error -r example.com.json -o example.com-chk.json
250```
251
252Use root key as DNSSEC trust anchor, to additionally indicate
253authentication status of responses:
254```
255$ dig +noall +answer . dnskey | awk '$5 % 2 { print $0 }' > tk.txt
256$ dnsviz grok -l info -t tk.txt -r example.com.json -o example.com-chk.json
257```
258
259Pipe `dnsviz probe` output directly to `dnsviz grok`:
260```
261$ dnsviz probe example.com | \
262      dnsviz grok -l info -o example.com-chk.json
263```
264
265Same thing, but save the raw output (for re-use) along the way:
266```
267$ dnsviz probe example.com | tee example.com.json | \
268      dnsviz grok -l info -o example.com-chk.json
269```
270
271Assess multiple names at once with error level:
272```
273$ dnsviz grok -l error -r multiple.json -o example.com-chk.json
274```
275
276
277### dnsviz graph
278
279`dnsviz graph` takes serialized query results in JSON format (i.e., output from
280`dnsviz probe`) as input and assesses specified domain names based on their
281corresponding content in the input.  The output is an image file, a `dot`
282(directed graph) file, or an HTML file, depending on the options passed.
283
284
285#### Examples
286
287Process the query/response output produced by `dnsviz probe`, and produce a
288graph visually representing the results in a png file named "example.com.png".
289```
290$ dnsviz graph -Tpng < example.com.json > example.com.png
291```
292
293Same thing:
294```
295$ dnsviz graph -Tpng -o example.com.png example.com < example.com.json
296```
297
298Same thing, but produce interactive HTML format:
299interactive HTML output in a file named "example.com.html":
300```
301$ dnsviz graph -Thtml < example.com.json > example.com.html
302```
303
304Same thing (filename is derived from domain name and output format):
305```
306$ dnsviz graph -Thtml -O -r example.com.json
307```
308
309Use alternate DNSSEC trust anchor:
310```
311$ dig +noall +answer example.com dnskey | awk '$5 % 2 { print $0 }' > tk.txt
312$ dnsviz graph -Thtml -O -r example.com.json -t tk.txt
313```
314
315Pipe `dnsviz probe` output directly to `dnsviz graph`:
316```
317$ dnsviz probe example.com | \
318      dnsviz graph -Thtml -O
319```
320
321Same thing, but save the raw output (for re-use) along the way:
322```
323$ dnsviz probe example.com | tee example.com.json | \
324      dnsviz graph -Thtml -O
325```
326
327Process analysis of multiple domain names, creating an image for each name
328processed:
329```
330$ dnsviz graph -Thtml -O -r multiple.json
331```
332
333Process analysis of multiple domain names, creating a single image for all
334names.
335```
336$ dnsviz graph -Thtml -r multiple.json > multiple.html
337```
338
339
340### dnsviz print
341
342`dnsviz print` takes serialized query results in JSON format (i.e., output from
343`dnsviz probe`) as input and assesses specified domain names based on their
344corresponding content in the input.  The output is textual output suitable for
345file or terminal display.
346
347
348#### Examples
349
350Process the query/response output produced by `dnsviz probe`, and output the
351results to the terminal:
352```
353$ dnsviz print < example.com.json
354```
355
356Use alternate DNSSEC trust anchor:
357```
358$ dig +noall +answer example.com dnskey | awk '$5 % 2 { print $0 }' > tk.txt
359$ dnsviz print -r example.com.json -t tk.txt
360```
361
362Pipe `dnsviz probe` output directly to `dnsviz print`:
363```
364$ dnsviz probe example.com | \
365      dnsviz print
366```
367
368Same thing, but save the raw output (for re-use) along the way:
369```
370$ dnsviz probe example.com | tee example.com.json | \
371      dnsviz print
372```
373
374
375### dnsviz query
376
377`dnsviz query` is a wrapper that couples the functionality of `dnsviz probe`
378and `dnsviz print` into a tool with minimal dig-like usage, used to make
379analysis queries and return the textual output to terminal or file output in
380one go.
381
382
383#### Examples
384
385Analyze the domain name example.com using the first of your configured DNS
386resolvers (i.e., in `/etc/resolv.conf`):
387```
388$ dnsviz query example.com
389```
390
391Same, but specify an alternate trust anchor:
392```
393$ dnsviz query +trusted-key=tk.txt example.com
394```
395
396Analyze example.com through the recursive resolver at 192.0.2.1:
397```
398$ dnsviz query @192.0.2.1 +trusted-key=tk.txt example.com
399```
400
401
402## Pre-Deployment DNS Testing
403
404The examples in this section demonstrate usage of DNSViz for pre-deployment
405testing.
406
407
408### Pre-Delegation Testing
409
410The following examples involve issuing diagnostic queries for a zone before it
411is ever delegated.
412
413Issue queries against a zone file on the local system (`example.com.zone`).
414`named(8)` is invoked to serve the file locally:
415```
416$ dnsviz probe -A -x example.com+:example.com.zone example.com
417```
418(Note the use of "+", which designates that the parent servers should not be
419queried for DS records.)
420
421Issue queries to a server that is serving the zone:
422```
423$ dnsviz probe -A -x example.com+:192.0.2.1 example.com
424```
425(Note that this server doesn't need to be a server in the NS RRset for
426example.com.)
427
428Issue queries to the servers in the authoritative NS RRset, specified by name
429and/or address:
430```
431$ dnsviz probe -A \
432      -x example.com+:ns1.example.com=192.0.2.1 \
433      -x example.com+:ns2.example.com=192.0.2.1,ns2.example.com=[2001:db8::1] \
434      example.com
435```
436
437Specify the names and addresses corresponding to the future delegation NS
438records and (as appropriate) A/AAAA glue records in the parent zone (com):
439```
440$ dnsviz probe -A \
441      -N example.com:ns1.example.com=192.0.2.1 \
442      -N example.com:ns2.example.com=192.0.2.1,ns2.example.com=[2001:db8::1] \
443      example.com
444```
445
446Also supply future DS records:
447```
448$ dnsviz probe -A \
449      -N example.com:ns1.example.com=192.0.2.1 \
450      -N example.com:ns2.example.com=192.0.2.1,ns2.example.com=[2001:db8::1] \
451      -D example.com:dsset-example.com. \
452      example.com
453```
454
455
456### Pre-Deployment Testing of Authoritative Zone Changes
457
458The following examples involve issuing diagnostic queries for a delegated zone
459before changes are deployed.
460
461Issue diagnostic queries for a new zone file that has been created but not yet
462been deployed (i.e., with changes to DNSKEY or other records):
463```
464$ dnsviz probe -A -x example.com:example.com.zone example.com
465```
466(Note the absence of "+", which designates that the parent servers will be
467queried for DS records.)
468
469Issue queries to a server that is serving the new version of the zone:
470```
471$ dnsviz probe -A -x example.com:192.0.2.1 example.com
472```
473(Note that this server doesn't need to be a server in the NS RRset for
474example.com.)
475
476
477### Pre-Deployment Testing of Delegation Changes
478
479The following examples involve issuing diagnostic queries for a delegated zone
480before changes are deployed to the delegation, glue, or DS records for that
481zone.
482
483Specify the names and addresses corresponding to the new delegation NS records
484and (as appropriate) A/AAAA glue records in the parent zone (com):
485```
486$ dnsviz probe -A \
487      -N example.com:ns1.example.com=192.0.2.1 \
488      -N example.com:ns2.example.com=192.0.2.1,ns2.example.com=[2001:db8::1] \
489      example.com
490```
491
492Also supply the replacement DS records:
493```
494$ dnsviz probe -A \
495      -N example.com:ns1.example.com=192.0.2.1 \
496      -N example.com:ns2.example.com=192.0.2.1,ns2.example.com=[2001:db8::1] \
497      -D example.com:dsset-example.com. \
498      example.com
499```
500
501
502## Docker Container
503
504A ready-to-use docker container is available for use.
505
506```
507docker pull dnsviz/dnsviz
508```
509
510This section only covers Docker-related examples, for more information see the
511[Usage](#usage) section.
512
513
514### Simple Usage
515
516```
517$ docker run dnsviz/dnsviz help
518$ docker run dnsviz/dnsviz query example.com
519```
520
521
522### Working with Files
523
524It might be useful to mount a local working directory into the container,
525especially when combining multiple commands or working with zone files.
526
527```
528$ docker run -v "$PWD:/data:rw" dnsviz/dnsviz probe dnsviz.net > probe.json
529$ docker run -v "$PWD:/data:rw" dnsviz/dnsviz graph -r probe.json -T png -O
530```
531
532
533### Using a Host Network
534
535When running authoritative queries, a host network is recommended.
536
537```
538$ docker run --network host dnsviz/dnsviz probe -4 -A example.com > example.json
539```
540
541Otherwise, you're likely to encounter the following error:
542`dnsviz.query.SourceAddressBindError: Unable to bind to local address (EADDRNOTAVAIL)`
543
544
545### Interactive Mode
546
547When performing complex analyses, where you need to combine multiple DNSViz
548commands, use bash redirection, etc., it might be useful to run the container
549interactively:
550
551```
552$ docker run --network host -v "$PWD:/data:rw" --entrypoint /bin/sh -ti dnsviz/dnsviz
553/data # dnsviz --help
554```
555