Dear Expert
In /etc/resolv.conf , we have 3 DNS, one of DNS was having issue, due to this issue, nearly all HOSTs giving error : "Plugin timed out after 10 seconds".
We removed (disabled) that DNS (10.20.30.40) from this /etc/resolv.conf file and issue got fixed.
FYI, we are not fully depend on this DNS server (10.20.30.40) to resolve the HOSTs. We rely on our localhost DNS (/etc/hosts file), so how to prioritize localhost DNS (/etc/hosts) file to be our Prime DNS to resolve Nagios HOSTs? You know it will never fail.
Regards
how to prioritize localhost /etc/hosts as DNS
Re: how to prioritize localhost /etc/hosts as DNS
The file that controls the order in which lookups are done is this file.
The option that controls the order of the look ups is the hosts: option.
If the option is set like below, it should look in the hosts file first and if it cannot find the host, it will do a DNS lookup.
Fore more details, you can look at the MAN page.
http://man7.org/linux/man-pages/man5/ns ... onf.5.html
Code: Select all
/etc/nsswitch.confIf the option is set like below, it should look in the hosts file first and if it cannot find the host, it will do a DNS lookup.
Code: Select all
hosts: files dnshttp://man7.org/linux/man-pages/man5/ns ... onf.5.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: how to prioritize localhost /etc/hosts as DNS
Dear tgriep
We checked and found the setting is same what you suggest/recommended. Its already there, even though why the plugin time out alert generated?
more /etc/nsswitch.conf | grep hosts
#hosts: db files nisplus nis dns
hosts: files dns
Regards
We checked and found the setting is same what you suggest/recommended. Its already there, even though why the plugin time out alert generated?
more /etc/nsswitch.conf | grep hosts
#hosts: db files nisplus nis dns
hosts: files dns
Regards
Re: how to prioritize localhost /etc/hosts as DNS
This is more of a general Linux/networking question than a Nagios question. As far as I know we don't touch anything related to DNS on install or upgrade. You would do best to find a network admin to look into this issue, as it is somewhat out of scope for what we support.
Former Nagios employee