Skip to content

Override root hints properly when doing undelegated tests on the root zone - #466

Merged
marc-vanderwal merged 1 commit into
zonemaster:developfrom
marc-vanderwal:bugfix/#465
Sep 21, 2026
Merged

marc-vanderwal merged 1 commit into
zonemaster:developfrom
marc-vanderwal:bugfix/#465

Conversation

@marc-vanderwal

Copy link
Copy Markdown
Contributor

Purpose

This PR fixes a programming oversight where undelegated tests on the root zone would behave in an unexpected way. The undelegated data was merely added to the already-loaded root hints, instead of completely overriding them as one would expect.

Context

Fixes #465.

Changes

  • Add (previously failing) unit test
  • Clear previously-loaded root hints when processing undelegated data for the root zone

How to test this PR

Unit tests have been updated and should pass.

You can also test manually by running the following command (but this is exactly what the newly-added unit test does):

$ zonemaster-cli --restore t/usage.undel-root.data \
    --test=DELEGATION01 --level=INFO --raw \
    --ns ns1/127.1.0.1 --ns ns1/fda1:b2:c3:0:127:1:0:1 \
    --ns ns2/127.1.0.2 --ns ns2/fda1:b2:c3:0:127:1:0:2 . | grep 'ENOUGH_IPV[46]_NS_CHILD'

Examine the output. It should be identical to this:

   0.00 INFO     ENOUGH_IPV4_NS_CHILD  count=2; minimum=2; ns_list=ns1/127.1.0.1;ns2/127.1.0.2
   0.00 INFO     ENOUGH_IPV6_NS_CHILD  count=2; minimum=2; ns_list=ns1/fda1:b2:c3:0:127:1:0:1;ns2/fda1:b2:c3:0:127:1:0:2

As an example, the following output is incorrect:

   0.00 INFO     ENOUGH_IPV4_NS_CHILD  count=15; minimum=2; ns_list=a.root-servers.net/198.41.0.4;b.root-servers.net/170.247.170.2;c.root-servers.net/192.33.4.12;d.root-servers.net/199.7.91.13;e.root-servers.net/192.203.230.10;f.root-servers.net/192.5.5.241;g.root-servers.net/192.112.36.4;h.root-servers.net/198.97.190.53;i.root-servers.net/192.36.148.17;j.root-servers.net/192.58.128.30;k.root-servers.net/193.0.14.129;l.root-servers.net/199.7.83.42;m.root-servers.net/202.12.27.33;ns1/127.1.0.1;ns2/127.1.0.2
   0.00 INFO     ENOUGH_IPV6_NS_CHILD  count=15; minimum=2; ns_list=a.root-servers.net/2001:503:ba3e::2:30;b.root-servers.net/2801:1b8:10::b;c.root-servers.net/2001:500:2::c;d.root-servers.net/2001:500:2d::d;e.root-servers.net/2001:500:a8::e;f.root-servers.net/2001:500:2f::f;g.root-servers.net/2001:500:12::d0d;h.root-servers.net/2001:500:1::53;i.root-servers.net/2001:7fe::53;j.root-servers.net/2001:503:c27::2:30;k.root-servers.net/2001:7fd::1;l.root-servers.net/2001:500:9f::42;m.root-servers.net/2001:dc3::35;ns1/fda1:b2:c3:0:127:1:0:1;ns2/fda1:b2:c3:0:127:1:0:2

@marc-vanderwal marc-vanderwal added T-Bug Type: Bug in software or error in test case description V-Patch Versioning: The change gives an update of patch in version. RC-Fixes Release category: Fixes. labels Aug 10, 2026
When the zone being tested is the root zone and undelegated data was
provided by the user, zonemaster-cli failed to discard all previously
loaded root hints before taking the undelegated data into account.
Instead, the undelegated data was simply merged with the existing hints.

For example, if doing an undelegated test of the root zone with
undelegated data calling the root name servers “ns1” and “ns2”,
previously, a test like Delegation01 erroneously reported 15
authoritative name servers in the child zone (13 from the built-in root
hints + 2 from the undelegated data), instead of just 2.
@matsduf

matsduf commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

@marc-vanderwal, can this PR be merged?

@marc-vanderwal

Copy link
Copy Markdown
Contributor Author

Yes. I will merge it then.

@marc-vanderwal
marc-vanderwal merged commit 3f2523d into zonemaster:develop Sep 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RC-Fixes Release category: Fixes. T-Bug Type: Bug in software or error in test case description V-Patch Versioning: The change gives an update of patch in version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Undelegated tests of root zones do not override root hints completely

3 participants