Page 1 of 1

external dns check

Posted: Tue Dec 22, 2020 9:47 am
by mejokj
Hello,

And ask external dns check monitoring, how can we achieve that.


The below example the http://www.google.com we configured Is this external check ?
[nagios@emea-nagios-a libexec]$ /usr/local/nagios/libexec/check_dns -H http://www.google.com -s mx-dsa
DNS OK: 1.054 second response time. http://www.google.com returns 172.217.22.4|time=1.054017s;;;0.000000

Re: external dns check

Posted: Tue Dec 22, 2020 12:50 pm
by dchurch
Firstly, DNS names can't have a protocol in them. You'll want to use www.google.com without the https://.

Secondly, do you mean sending a DNS query to a server on your LAN? You can do that by specifying -s <IP ADDRESS>. It's not possible to do a DNS lookup by DNS name because that's not how DNS works. (Note: If you have an /etc/hosts file entry, you can use that instead of an IP address.)

An example command for looking up a DNS name by sending a DNS lookup request to Google's DNS server, 8.8.8.8 is the following:

Code: Select all

/usr/local/nagios/libexec/check_dns -H www.google.com -s 8.8.8.8
Let me know if this answers your question.