zonemaster / zonemaster-cli

The Zonemaster CLI - part of the Zonemaster project
Other
20 stars 21 forks source link

Undelegated test (CLI) ignores name that does not resolve to address #39

Closed matsduf closed 7 years ago

matsduf commented 7 years ago

As @aabdnn writes in issue https://github.com/dotse/zonemaster-engine/issues/278 there is a bug in Zonemaster-CLI when an undelegated test is fed with name that cannot be resolved to an address:

I expect this test to fail (because name server abcdef does not exist):

zonemaster-cli 193.in-addr.arpa --ns pri.authdns.ripe.net --ns sns-pb.isc.org --ns tinnie.arin.net --ns sec3.apnic.net --ns abcdef

However, Zonemaster (CLI 1.0.5, engine 1.0.16) happily passes this, with no errors emitted.

As far as I can see, method add_fake_delegation in Zonemaster/CLI.pm just ignores any name that cannot be resolved to an address.

        if ($ip) {
            push @{ $data{ $self->to_idn( $name ) } }, $ip;
        }
        else {
            my $n = $self->to_idn( $name );
            my @ips = Net::LDNS->new->name2addr($n);
            push @{ $data{$n} }, $_ for @ips;
        }

If name is fed without address, the address is looked up with my @ips = Net::LDNS->new->name2addr($n); and if that returns nothing, the name is ignored.

vlevigneron commented 7 years ago

Fixed in https://github.com/dotse/zonemaster-cli/pull/41