DNS query (dns)
Looks up one name and record type at a resolver and reports how long the answer took and how many records came back. It can require certain values among the answers. It tells the ways a lookup can go wrong apart: a name that does not exist, a name with no record of the asked type, a resolver that fails, a resolver that refuses, and a resolver that does not answer.
Channels
| Key | Name | Unit | Default limits |
|---|---|---|---|
response_ms | Response time | ms | warning above 500, error above 2000 |
answer_count | Answers | none | none |
answer_count counts the records of the asked type; a CNAME on the way to them is not counted.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
name | required | The name to look up, for example www.example.org. A trailing dot is fine. |
record_type | A | A, AAAA, CNAME, MX, NS, PTR, SRV or TXT. |
resolver | the probe host's resolvers | The IP address of the resolver to ask. |
query_target | false | Ask the device the sensor is attached to. Use it to monitor a DNS server itself. Cannot be combined with resolver. |
port | 53 | UDP and TCP port of the resolver. |
expected | none | Up to 16 values that must all appear among the answers, compared without regard to case or a trailing dot. Addresses, names, 10 mail.example.org for MX, priority weight port target for SRV, the text of a TXT record. |
Suggested interval: 60 seconds. No credential.
Without resolver or query_target the sensor asks the nameservers in /etc/resolv.conf of the probe host, the first three in order, until one answers. A truncated UDP answer is repeated over TCP.
What each outcome means
| Outcome | Result |
|---|---|
| Answers, and all expected values present | Up. |
NXDOMAIN: <name> does not exist | Down. The poll succeeded; the name is not there. |
<name> exists but has no <TYPE> records | Down. |
<name> <TYPE> answer lacks <values> | Down. The message lists what came back. |
SERVFAIL from <server> (kind protocol) | Collection failure. The resolver could not get an answer, for example because its upstream is down. |
REFUSED by <server> (kind protocol) | Collection failure. The server will not answer this client; recursion may be limited to certain networks. |
<server> did not answer within N ms (kind timeout) | Collection failure. |
no DNS resolver is configured (kind config) | The probe host has no nameserver and the sensor names none. |
On the target
A DNS server that answers the probe host on UDP and TCP port 53, or the port you set. Nothing is installed.