Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

NET::DNS

by Anonymous Monk
on Apr 28, 2003 at 16:46 UTC ( #253744=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

On my windows machine I cannot get any of the examples from www.cpan.org to work. I know the module is installed correctly and there aren't any noticable errors in the code that my program or CMD will pick up. I looked through the docs and FAQs but it never said it can't work for Windows machines. The error I get is: query failed: connection failed for both snippets I tried. Anyone know what might be the problem or know of another module which might work?

Replies are listed 'Best First'.
Re: NET::DNS
by jand (Friar) on Apr 28, 2003 at 18:39 UTC
    Net::DNS has been broken on Windows for a while. I can't remember which version was the last to work though. You may want to try older versions from the Net::DNS website.
Re: NET::DNS
by Improv (Pilgrim) on Apr 28, 2003 at 17:59 UTC
    A few things:
    • Is DNS set up correctly on your system? Do other DNS queries work? (e.g. can IE or Mozilla resolve www.cnn.com?)
    • What version of Net::DNS are you using?
    • What examples are you trying? What errors do they give?
    • Yes, IE can go to websites.
    • Version is 0.34
    • One of the examples are
      #/usr/bin/perl -w use warnings; use strict; use Net::DNS; my $rr; my $res = Net::DNS::Resolver->new; my $query = $res->query("http://www.yahoo.com", "NS"); if ($query) { foreach $rr ($query->answer) { next unless $rr->type eq "NS"; print $rr->nsdname, "\n"; } } else { print "query failed: ", $res->errorstring, "\n"; }
        Ok, by not working, does it print 'query failed', or does it die, or do something else? Is it possible you're behind a firewall, and just accessing the web through a proxy?
Re: NET::DNS
by jand (Friar) on May 08, 2003 at 02:08 UTC
    I needed Net::DNS myself, and even the earlier versions (0.12) didn't work on my Win2K Server box, so I tried to figure out what is wrong.

    It looks like Net::DNS doesn't discover the name servers correctly. I added some code for both Win 95/98/Me as well as some (different) code for 2K / XP. Windows NT however should work as is.

    You can find my patch attached to the corresponding RT ticket.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://253744]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2023-12-07 20:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (33 votes). Check out past polls.

    Notices?