Subject: | recursion desired flag not maintained. |
This code, running on Perl 5.8.0 appears to lose the recursion desired (RD) flag:
print STDERR "Net::DNS Version: ", Net::DNS->version(), "\n";
my $resolver = Net::DNS::Resolver->new;
$resolver->nameservers("127.0.0.1");
my($name)="example.zone";
my($packet) = Net::DNS::Packet->new($name);
$packet->header->rd(0);
print STDERR "RD flag: ", $packet->header->rd(), "\n";
my($query) = $resolver->send($packet);
print STDERR "RD flag: ", $query->header->rd(), "\n";
Output:
Net::DNS Version: 0.34
RD flag: 0
RD flag: 1
Running the same query with dig:
dig +norec example.zone @127.0.0.1
shows that the name server returns the RD flag=0.