Hello, I have trouble getting the Perl DNS Resolver Module working. I'm using it in sa-update (for updating spamassassin rules). This is the error I get in the log file:
warn: Error creating a DNS resolver socket: No such file or directory + at /opt/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/DnsResolver.pm l +ine 203
The DnsResolver.pm-file is present, and the code that generates the error message is here:
my $port_offset = int(rand(64511)); # 65535 - 1024 for (my $i = 0; $i<64511; $i++) { my $lport = 1024 + (($port_offset + $i) % 64511); my %args = ( PeerAddr => $ns, PeerPort => $self->{res}->{port}, Proto => 'udp', LocalPort => $lport, Type => SOCK_DGRAM, Domain => $family, ); if (HAS_SOCKET_INET6) { $sock = IO::Socket::INET6->new(%args); } else { $sock = IO::Socket::INET->new(%args); } $errno = $!; if (defined $sock) { # ok, got it last; } elsif ($! == EADDRINUSE) { # in use, let's try another source p +ort dbg("dns: UDP port $lport already in use, trying another port"); } else { # did we fail due to the attempted use of an IPv6 nameserver? $self->_ipv6_ns_warning() if (!$ipv6 && $errno==EINVAL); warn "Error creating a DNS resolver socket: $errno"; goto no_sock; } } if (!defined $sock) { warn "Can't create a DNS resolver socket: $errno"; goto no_sock; }
If I run "print $res->string;", I get this output:
;; RESOLVER state: ;; domain = ;; searchlist = ;; nameservers = <DNS IP's protected) ;; port = 53 ;; srcport = 0 ;; srcaddr = 0.0.0.0 ;; tcp_timeout = 120 ;; retrans = 5 retry = 4 ;; usevc = 0 stayopen = 0 igntc = 0 ;; defnames = 1 dnsrch = 1 ;; recurse = 1 debug = 0
If I run a "dnstracer"-command I get reply, so it seems to be Perl-related. Any ideas? Thanks, Ibux

In reply to Error creating a DNS resolver socket by ibux

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.