The following command line on a zone where one of its name server names points to an alias (CNAME) causes infinite looping:
$ zonemaster-cli --test basic02 --level info chi-eureseine.fr
Seconds Level Message
======= ======== =======
0.00 INFO Using version v7.0.0 of the Zonemaster engine.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_recurse" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 442.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_do_query" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 297.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::get_addresses_for" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 385.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_resolve_cname" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 317.
Deep recursion on subroutine "Zonemaster::Engine::Recursor::_resolve_cname" at /home/vanderwal/.perl5/lib/perl5/Zonemaster/Engine/Recursor.pm line 317.
Explanation
Why does it happen on chi-eureseine.fr? And why does it happen with Basic02?
In the process of executing the test case, a SOA query for chi-eureseine.fr is done. Zonemaster eventually gets a referral to ns.crihan.fr and ns.ch-eureseine.fr, with glue only for ns.crihan.fr; both are out-of-bailiwick (yes, the second one as well; there is no typo).
Zonemaster then attempts to get A records for ns.ch-eureseine.fr. The ch-eureseine.fr zone is delegated to ns.crihan.fr (with glue) and ns.chi-eureseine.fr.
It eventually gets a response from ns.crihan.fr: ns.ch-eureseine.fr is an alias for lxnsext.ch-eureseine.fr. There is an A record in the response, so Zonemaster stops there.
But then, Zonemaster attempts to get AAAA records for ns.ch-eureseine.fr. This time, it gets the same CNAME resource record from ns.crihan.fr without any AAAA records in the same response, because there are none.
Because of that, Zonemaster restarts a recursive query for lxnsext.ch-eureseine.fr/AAAA. In the process, it forgets that it was actually trying to resolve AAAA records for ns.ch-eureseine.fr to get the SOA record for chi-eureseine.fr. Zonemaster sees that it needs to resolve AAAA records for ns.ch-eureseine.fr in the process of resolving lxnsext.ch-eureseine.fr/AAAA, gets the lone CNAME again, and retries the recursive query for lxnsext.ch-eureseine.fr/AAAA once again, forgetting all context again. This goes on infinitely, until zonemaster-engine is killed.
The following command line on a zone where one of its name server names points to an alias (CNAME) causes infinite looping:
Explanation
Why does it happen on
chi-eureseine.fr? And why does it happen with Basic02?In the process of executing the test case, a SOA query for
chi-eureseine.fris done. Zonemaster eventually gets a referral tons.crihan.frandns.ch-eureseine.fr, with glue only forns.crihan.fr; both are out-of-bailiwick (yes, the second one as well; there is no typo).Zonemaster then attempts to get A records for
ns.ch-eureseine.fr. Thech-eureseine.frzone is delegated tons.crihan.fr(with glue) andns.chi-eureseine.fr.It eventually gets a response from
ns.crihan.fr:ns.ch-eureseine.fris an alias forlxnsext.ch-eureseine.fr. There is an A record in the response, so Zonemaster stops there.But then, Zonemaster attempts to get AAAA records for
ns.ch-eureseine.fr. This time, it gets the same CNAME resource record fromns.crihan.frwithout any AAAA records in the same response, because there are none.Because of that, Zonemaster restarts a recursive query for
lxnsext.ch-eureseine.fr/AAAA. In the process, it forgets that it was actually trying to resolve AAAA records forns.ch-eureseine.frto get the SOA record forchi-eureseine.fr. Zonemaster sees that it needs to resolve AAAA records forns.ch-eureseine.frin the process of resolvinglxnsext.ch-eureseine.fr/AAAA, gets the lone CNAME again, and retries the recursive query forlxnsext.ch-eureseine.fr/AAAAonce again, forgetting all context again. This goes on infinitely, untilzonemaster-engineis killed.