Results 1 to 13 of 13

Thread: SpamAssassin: No DNS servers available!

  1. #1

    SpamAssassin: No DNS servers available!

    A bug in the Net::DNS was reported causing error that look like this:
    Code:
    Oct 11 16:54:09 server spamd[474]: plugin: eval failed: available_nameservers: No DNS servers available!
    Oct 11 16:54:09 server spamd[474]: rules: failed to run NO_DNS_FOR_FROM RBL test, skipping:
    Oct 11 16:54:09 server spamd[474]:  (available_nameservers: [...] No DNS servers available!)
    Oct 11 16:54:09 server spamd[474]: spf: lookup failed: available_nameservers: No DNS servers available!
    Oct 11 16:54:09 server spamd[474]: spf: lookup failed: available_nameservers: No DNS servers available!
    So we've got a guide here to help repair it:
    http://help.directadmin.com/item.php?id=570

    I've also added the patch directly into the Mail-SpamAssassin-3.4.0.tar.gz which will cause this error in custombuild when you update, which will be normal and can be ignored:
    Code:
    File already exists:    Mail-SpamAssassin-3.4.0.tar.gz
    
    *** MD5 Checksum for Mail-SpamAssassin-3.4.0.tar.gz Failed.  Redownloading...***
    
    
    Downloading             Mail-SpamAssassin-3.4.0.tar.gz...
    --2014-10-11 16:33:27--  http://files1.directadmin.com/services/custombuild/Mail-SpamAssassin-3.4.0.tar.gz
    Resolving files1.directadmin.com... 216.144.254.90
    Connecting to files1.directadmin.com|216.144.254.90|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 1294260 (1.2M) [application/x-gzip]
    Saving to: `/usr/local/directadmin/custombuild/Mail-SpamAssassin-3.4.0.tar.gz'
    
    
    100%[==========================================================================================================================================>] 1,294,260   --.-K/s   in 0.1s
    
    
    2014-10-11 16:33:27 (11.2 MB/s) - `/usr/local/directadmin/custombuild/Mail-SpamAssassin-3.4.0.tar.gz' saved [1294260/1294260]
    
    
    MD5 Checksum on Mail-SpamAssassin-3.4.0.tar.gz passed.
    John

  2. #2
    Join Date
    Apr 2009
    Posts
    2,393
    I don't find any of those errors in any of my log files. So I might not be affected then? Is there any easy way to find out if I am affected?

    Would recompiling SpamAssassin in custombuild also fix the issue? (I noticed that when doing ./build update it redownloaded SpamAssassin)

  3. #3
    It was reported to us from a client, and then I noticed it was doing the same thing one of our brand new test boxes..
    our current da.com server was installed maybe 1 year ago and wasn't affected, so not 100% sure on the conditions.
    You'd probably know fairly quickly if you were affected; those error above showed up for every single email coming in that was scanned.
    If your mail headers show scores that include dns (spf, reverse dns, rbl, etc...) then you're probably not affected.

    If you do re-install SA via CB, it would probably ensure you've got the patch, but again, I'm not 100% sure on the details on how to duplicate it exactly.

    John

  4. #4
    Join Date
    Aug 2006
    Location
    LT, EU
    Posts
    8,070
    ditto, the bug affects Net:: DNS version >= 0.76 only, that's why you might be not experiencing problems on your box
    Martynas Bendorius
    MB Martynas IT. Professional server management company. Official DirectAdmin, CloudLinux, LiteSpeed and Comodo partners.

  5. #5
    Join Date
    Apr 2009
    Posts
    2,393
    @smtalk, I went into cpan and typed r to get the versions of all modules. It said I have Net:: DNS 0.74.

    @John, thank you, then I might wait until the next SpamAssassin version is released before I recompile.

  6. #6
    Join Date
    Sep 2014
    Location
    Almeria (España)
    Posts
    12
    its a bug
    just editing an file and restarting exim will solved.

    Code:
    --- Mail/SpamAssassin/DnsResolver.pm.orig 2014-05-07 
    17:54:29.000000000 +0200 
    +++ Mail/SpamAssassin/DnsResolver.pm 2014-06-18 02:13:32.936306639 
    +0200 
    @@ -205,6 +205,8 @@ 
    dbg("dns: servers set by config to: %s", join(', ',@ns_addr_port)); 
    } elsif ($res) { # default as provided by Net::DNS, e.g. 
    /etc/resolv.conf 
    - @ns_addr_port = map(untaint_var("[$_]:" . $res->{port}), 
    - @{$res->{nameservers}}); 
    + my @ns = $res->UNIVERSAL::can('nameservers') ? $res->nameservers 
    + : 
    @{$res->{nameservers}}; 
    + my $port = $res->UNIVERSAL::can('port') ? $res->port : 
    $res->{port}; 
    + @ns_addr_port = map(untaint_var("[$_]:" . $port), @ns); 
    dbg("dns: servers obtained from Net::DNS : %s", join(', 
    ',@ns_addr_port)); 
    }
    source : http://www.gossamer-threads.com/list...n/users/185470

    OR apply the patch from directadmin.

    IF : spamd[474]: spf: lookup failed: available_nameservers: No DNS servers available! <-- INTO LOG
    THEN...
    Code:
    cd /root
    wget http://files1.directadmin.com/services/custombuild/patches/dns_resolver.patch
    patch -p0 < dns_resolver.patch
    finally restart spamd via exim
    Code:
    /etc/init.d/exim restart
    Last edited by cRipTz; 10-13-2014 at 02:26 AM.

  7. #7
    Join Date
    Sep 2015
    Location
    Arnhem, NL
    Posts
    428
    I am still getting this error when i check with systemctl status spamassassin.service. Every message that is coming in gets this error. I tried rebuilding with CustomBuild, applying the patch, nothing resolves this error. I have all the modules installed that SpamAssassin is using and everything is up2date. I have two IPv6 nameservers, tried it with IPv4 and no improvement. I am using CentOS 7.

    Does anybody has a clue what the issue could be? I'm out of ideas

  8. #8
    If the nameservers are IPv6, perhaps try editing:
    /etc/systemd/system/spamassassin.service

    and remove --ipv4 in the ExecStart line.

    Then restart the spamassassin service (systemd will tell you to reload the script, so just run it's mentioned command)

    Might not be a bad idea to add the "nameserver 8.8.8.8" to the bottom of your /etc/resolv.conf file, as an IPv4 backup... or even 127.0.0.1, so it has something to use, in case it can't figure out IPv6 nameservers.

    John

  9. #9
    Join Date
    Sep 2015
    Location
    Arnhem, NL
    Posts
    428
    Thanks!! That was it. It's working now!

    If i build SpamAssassin again or there is an update available, do i need to make these changes again?

    Again, thanks for the quick reply!

  10. #10
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,598
    Hello,

    Directadmin does not touch /etc/resolv.conf , so your customization should be save, unless you run a VPS server based on OpenVZ. If you do run an OpenVZ VPS then the file will be reset to its original view with a server reboot.
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

  11. #11
    Join Date
    Sep 2015
    Location
    Arnhem, NL
    Posts
    428
    Hello,

    I mean the changes made in /etc/systemd/sytem/spamassassin.service I did not change my resolve.conf, i would like to keep using the IPv6 nameservers from my VPS provider.

    Removing the --ipv4 line in that file is working great. If i update or rebuild SpamAssassin, do i need to remove the --ipv4 line again?

  12. #12
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,598
    Copy the modified file to /usr/local/directadmin/custombuild/custom/systemd/. That should help.
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

  13. #13
    Join Date
    Sep 2015
    Location
    Arnhem, NL
    Posts
    428
    That worked great, thanks! Maybe an idea to add this to the FAQ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •