CentOS 7 Specific Cure For Spamassassin DNS Lookup Problem
I have the following error message in my /var/log/spamd
spf: lookup failed: available_nameservers: No DNS servers available!
Having Googled the error message I’ve found a number of responses which involve patching Perl or Spamassassin or other cures.
Before I start changing things I was wondering if there was a CentOS 7
specific resolution. Where possible, on production machines I prefer to stay with RPM’s rather than amending software directly.
Also, many of these responses are over 10 years old, so I’m a little sceptical about their success today.
Gary
Recommended
Recent Posts
Recent Comments
- igor on LibGLU.so.1
- Hussein on NBDE, Clevis And Tang For Non-root Disk
- João M. S. Silva on CentOS 7.6 1810 Vs. VirtualBox : Bug With Keyboard Layout Selection
- Jim Plumb on Spamassassin Vs. SELinux Trouble
- woodiskingser on Off Topic – Need Help Registering To The Smplayer Forum
Archives
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- June 2021
- May 2021
- April 2021
- March 2021
- February 2021
- January 2021
- December 2020
- November 2020
- October 2020
- September 2020
- August 2020
- July 2020
- June 2020
- May 2020
- April 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- September 2019
- August 2019
- July 2019
- June 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- February 2014
- January 2014
- April 2013
- December 2012
7 thoughts on - CentOS 7 Specific Cure For Spamassassin DNS Lookup Problem
One of the solutions that I’ve found is to add dns_server entries into the config file. As this did not entail updating the software this is the option I’ve chosen.
This has fixed the original ‘spf’ error message, but now gives me a different error message. I now get one or more
Use of uninitialized value $rr_type in string eq at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/AskDNS.pm line 592.
I’m now looking into this one, but any assistance would be appreciated.
Gary
I run SpamAssassin on CentOS 7; the SPF plugin is loaded via
/etc/mail/spamassassin/init.pre. I have no trouble with spf at all.
Is it possible the problem is with local DNS resolution?
Same here, no issues with spamassassin and SPF.
In addition to Paul’s question which seems like the most obvious initial avenue of investigation, I assume you have perl-Mail-SPF and perl-Net-DNS installed? They should be as both are deps for the spamassassin package.
Try starting spamassassin later. Run “systemctl edit spamassassin.service” and insert two lines:
[Unit]
After=network-online.target
I will add the code, although updating RPM contents is one of the things I was trying to avoid. Having said that, I have restarted the service after bootup has completed and this does not fix the problem.
Both deps are installed, and from what I can tell the SPF code was loading fine, but then failing when called.
Local DNS resolution was working fine, with the correct entries in resolve.conf, and nslookup, dig, and all other services working fine.
The research I had done into this error messsage stated that because of problems with Net::DNS SA had cheated and looked at the internals of the module to obtain the DNS list. These internals then broke which meant that SA
could no longer detect the DNS servers. By adding
dns_server x.x.x.x
to the local.cf I got round this problem and the error messages have gone.
However, as I said in my other post I am now getting
spamd[102425]: Use of uninitialized value $rr_type in string eq at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/AskDNS.pm line 592.
instead
Gary
“systemctl edit” creates a “drop-in” that overrides a portion of the vendor-provided file. It exists specifically to avoid editing rpm-provided files.
Well, that error can also be caused by Net::DNS being unable to parse
/etc/resolv.conf, or the spamassassin force_ipv4 or force_ipv6 setting with no DNS servers of that address family.
What does your /etc/resolv.conf look like?
You might also try starting spamd manually, and adding “-D dns” to the arguments currently used. That will log a good deal of additional information about the DNS configuration, and you should be able to figure out where spamd is getting its DNS servers (configuration or Net::DNS).