Maintained by: NLnet Labs

L-Root IPv6 address renumbering

Robert Edmonds
Wed Mar 16 18:46:11 CET 2016

W.C.A. Wijngaards via Unbound-users wrote:
> The sysadmin edits the root.hints file?  The unbound.conf file is just
> pointing to the root.hints file.  I don't really see sysadmins editing
> the root.hints file.  Only very sporadic, perhaps, updating it
> themselves.  But then they have to keep doing it?
> But that seems to be the only use case for the mtime comparison.  And
> it is very unusual?

Not quite, I want to avoid two things:

1) The sysadmin should never have to update the root hints by hand.
"apt update && apt upgrade" should upgrade any packages needed to bring
the root hints up to date.

2) The package maintainers shouldn't have to patch and rebuild each
package with compiled in root hints when a root server is renumbered.

> I do not like mixing the internal compiled root hints with the
> external file.  I would like the internal compiled root hints to shut
> off completely, when the root-hints config is given in unbound.conf.
> This to make sure that the user's choice of root servers is used, and
> the code does not (accidentally) use the wrong root servers.

I wasn't proposing changing the behavior of the existing root-hints
option, it would have had to have been a new option. Maybe
"newer-root-hints-file", with the mtime behavior implied by "newer-"
explicitly documented.

I would guess that most users don't make an active choice of whether to
use compiled in root hints or root hints from some file, they just
accept whatever the default behavior is. If they do make an explicit
choice by setting the "root-hints" option, that choice should be
respected, of course.

Basically, the logic would look like:

 - If the user explicitly configured "root-hints", use the requested
   root hints file unconditionally.

 - If "root-hints" unset and "newer-root-hints-file" unset, use the
   compiled in root hints.

 - If "root-hints" unset and "newer-root-hints-file" set to some
   filename then:

    1) If the file exists, check if its mtime is greater than the
    compiled in timestamp of the last time the root hint data in
    compile_time_root_prime() was updated. If so, load hints from the
    specified file and ignore the compiled in root hints.

    2) If the file does not exist, or its mtime is older than the
    compiled in root hints, use the compiled in root hints.

Then in the Debian package we would set by default:

    newer-root-hints-file: "/usr/share/dns/root.hints"

and depend on the package that provides /usr/share/dns/root.hints.

But maybe that's overly complicated for too little gain and we should
just set:

    root-hints: "/usr/share/dns/root.hints"

and keep the file up to date.

> But, having a second root-hints file, root-hints-backup or so?  And
> then mtime comparing it with the first root hints file, and using the
> newest of the two files?

Comparing mtime of two files, one of which is an editable config file,
can easily fail though (newer mtime on the config file containing older

> Also, would you want to have a configure-time default for the
> root-hints value, i.e. never use the compiled-in defaults and always
> read from a specific file (at default location)?  (that would be,
> unless overridden in unbound.conf).

This could be useful. We can ensure (through the package update
mechanism) that /usr/share/dns/root.hints will always be up-to-date.

Robert Edmonds
edmonds at