in reply to header information of a DNS

What do you mean by header information? HINFO records are host information; they hold the os and cpu for hosts. The Net::DNS::RR::HINFO objects holds the data. You need to read the Net::DNS documentation on how to do DNS queries.
my $res = Net::DNS::Resolver->new(); my $packet = $res->search('example.com', 'HINFO'); my ($rr) = $packet->answer(); print "cpu = ", $rr->cpu, " os = ", $rr->os, "\n";
Very few public domains on the Internet use HINFO records. Some internal domains do contain host info, but only if added explicitly by the administrator.

Replies are listed 'Best First'.
Re: Re: header information of a DNS
by Anonymous Monk on Mar 03, 2004 at 09:42 UTC
    When iam using this code use Net::DNS::Resolver; my $res = Net::DNS::Resolver->new(); my $packet = $res->search('www.indiaimage.nic.in', 'HINFO'); my ($rr) = $packet->answer(); print "cpu = ", $rr->cpu, " os = ", $rr->os, "\n"; Iam getting error: Can't call method "answer" on an undefined value at hinfo.pl line 4. My requiement is that If i give any hostname i have to get remote O.S. used by that host.
      You will need to check the Net::DNS documentation to find out what happens when the query fails or is not found. My guess is that the record is not found. You will need to check for this.

      This is not surprising since HINFO records are rare. Unless you know that that domain defines them, doing the query is not going to useful.