descriptionpre-heat a BIND cache
last changeThu, 12 Apr 2018 14:23:03 +0000 (15:23 +0100)

adns-masterfile: pre-heat a BIND cache

The adns-masterfile program reads an RFC 1035 DNS master file and makes queries for most of the records it contains using adns. The aim is to pre-heat a nameserver cache based on the contents of the file.

BIND's named_dump.db file is in DNS master file format, so you can pre-heat a remote cache based on the contents of this server's cache using:

    $ rndc dumpdb
    $ adns-masterfile -qqq -s REMOTE /var/run/named/named_dump.db

When there is a parser failure, adns-masterfile will abort with the error "flex scanner jammed". This might be an error in the input or it might be a bug in the parser.

Input file format

The adns-masterfile program supports a variant of the RFC 1035 standard DNS master file format. It is intended to be compatible with BIND's rndc dumpdb command, which makes named write the contents of its cache to named_dump.db in its working directory. This file is basically DNS master file format, but with a few extensions and restrictions.

There can be $DATE directives recording the time the dump was produced, which adns-masterfile ignores. Any other $ directives make adns-masterfile abort because they can have can have any kind of exciting effect on the semantics of master files.

The main task of adns-masterfile is to make queries for RRsets. These can be written using the following master file features:

Some master file features are not supported:

There is an extension for representing negative cache entries, which look like:

    nonexistent.domain.     1234    \-ANY   ;-$NXDOMAIN
    nonexistent.rrset.      1234    \-MX    ;-$NXRRSET

NXDOMAIN items cause adns-masterfile to make an A query. NSRRSET items cause a query for the particular RRset.

Because adns only knows a limited set of RRtypes, adns-masterfile will ignore records with other types. The supported types are:


As well as informational rubric, comments in named_dump.db can contain DNS RRs which are cached but not normally returned to clients (following RFC 2181 trustworthiness logic), plus non-DNS data such as nameserver reachability stats. Although they contain lots of interesting information, adns-masterfile ignores comments because the target nameserver will work out their contents for itself in the course of making the more interesting queries.

2018-04-12 Tony FinchPrint summary statistics before exit master
2018-04-12 Tony FinchThe -t option sends all queries over TCP
2018-04-12 Tony FinchThe -M option can make adns-masterfile stop early
2017-04-13 Tony FinchCorrect IPv6 reverse domain
2017-03-20 Tony Finch-f flag for forward DNS lookups only
2016-02-19 Tony FinchNeed to define _GNU_SOURCE before lex's #includes
2016-02-19 Tony Finch#define _GNU_SOURCE for asprintf() on Linux
2016-02-19 Tony Finchscale query batch size based on maxpending
2016-02-19 Tony Finchmake: use version of adns with TCP fix
2016-02-19 Tony Finchgetopt style
2016-02-19 Tony FinchPrint query status
2016-02-19 Tony FinchQuery for the correct type (whoops!!!)
2016-02-18 Tony FinchCOPYING
2016-02-18 Tony FinchPreen README
2016-02-08 Tony Finchmake: add an install target
2016-01-28 Tony FinchThe great renaming, named_dump_adns -> adns-masterfile
17 months ago master