Subject: | Unnecessary rd set in Recurse.pm |
I'm moving a discussion that initially started with private email to
Oalf. This and the following entry will consist of the initial email
exchange, the third will then be a new follow-up to Olaf's private reply.
--
From: John Kristoff <jtk@ultradns.net>
To: olaf@net-dns.org
Subject: Unnecessary rd enabled in Recurse.pm?
Date: Fri, 12 May 2006 13:41:11 -0500
Hi Olaf,
I am trying to use Net::DNS::Resolver::Recurse for a simple tool that
walks the tree, but I noticed that no matter what I did my first query
was able sent with the recursion desired flag set. This is not what I
want. Here is a sample piece of code based largely on the example in
the doc:
#!/usr/bin/perl -wT
use strict;
$|=1;
use Net::DNS::Resolver::Recurse;
my @root_hints = ( "192.5.5.241" );
my $res = Net::DNS::Resolver::Recurse->new;
$res->hints(@root_hints);
$res->recursion_callback(sub {
my $packet = shift;
$_->print for $packet->additional;
printf(";; Received %d bytes from %s\n\n",
$packet->answersize,
$packet->answerfrom
);
});
my $packet = $res->query_dorecursion( "depaul.edu.", "NS");
In a packet capture I notice the first query towards the root server
I gave the hint to will have the recursion desired flag set. Why is
this? I noticed in Recurse.pm on line 28 that you set recursion for
the query that asks one of the hint servers who it thanks is auth for
the root. While it won't generally hurt to have this I guess, I did
not want this behavior so I changed it. Can you explain this or is
this a bug?
I also noticed that if I don't set the hints the TLD will get a query
with rd set as well.
John