- changed status to closed
Select DNS resolver on host check
Issue #656
closed
It would be great if we can select DNS resolver on host check.
For example:
check host example.com with address example.com resolvers 8.8.8.8 or 8.8.4.4. every 15 cycles
if failed port 80 protocol http then alert
Comments (1)
-
repo owner - Log in to comment
Monit uses system resolver and cannot select which name services (such as files, dns, nis, ldap) or particular server should be used (that's resolver's business).
If nameservice itself needs to be tested on a specific DNS server, that server should be target of the test itself with a DNS protocol test, otherwise the error will be ambiguous, if bundled with the example.com:80 check. I think somethink like this would be more flexible (may also allow to test other records such as CNAME, NS, AAAA, etc.):
Custom queries are however currently not supported by the DNS protocol check ... you can use "check program" with custom script (based on nslookup or dig) that will make sure the host resolves correctly. Check program syntax: https://mmonit.com/monit/documentation/monit.html#PROGRAM-STATUS-TEST