SpamAssassin: No DNS servers available!


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » Email » Spam

SpamAssassin: No DNS servers available!Last Modified: Oct 11, 2014, 4:48 pm
A bug in the DnsResolver.pm (from Net::DNS) is causing SpamAssassin to throw errors such as these:

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!


There is a patch available, and you can fix your DnsResolver.pm file with the following commands:

1) Find your current DnsResolver.pm file, so we know where to patch.
On our test system, it looked like this:

[root@erin ~]# locate DnsResolver.pm
/root/.cpan/build/Mail-SpamAssassin-3.4.0-79YYso/lib/Mail/SpamAssassin/DnsResolver.pm
/usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm

Where we're interested in the 2nd line, because the .cpan/build is just a temporary location.

2) Backup your current DnsResolver.pm to a safe place:

cp /usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm /root


3) Download and apply the patch:

cd /root
wget http://files1.directadmin.com/services/custombuild/patches/dns_resolver.patch
patch -p0 < dns_resolver.patch

This will fail in that it won't be able to find your DnsResolver.pm file.

3) When patch asks, tell it where the file is:

[root@server ~]# patch -p0 < dns_resolver.patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm    2014/06/18 16:47:04     1603517
|+++ spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm    2014/06/18 16:48:04     1603518
--------------------------
File to patch: /usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm
patching file /usr/share/perl5/Mail/SpamAssassin/DnsResolver.pm


4) Lastly, restart spamd via exim:

/etc/init.d/exim restart



© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST