Skip to content

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 ​

KeyNameUnitDefault limits
response_msResponse timemswarning above 500, error above 2000
answer_countAnswersnonenone

answer_count counts the records of the asked type; a CNAME on the way to them is not counted.

Parameters ​

ParameterDefaultMeaning
namerequiredThe name to look up, for example www.example.org. A trailing dot is fine.
record_typeAA, AAAA, CNAME, MX, NS, PTR, SRV or TXT.
resolverthe probe host's resolversThe IP address of the resolver to ask.
query_targetfalseAsk the device the sensor is attached to. Use it to monitor a DNS server itself. Cannot be combined with resolver.
port53UDP and TCP port of the resolver.
expectednoneUp 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 ​

OutcomeResult
Answers, and all expected values presentUp.
NXDOMAIN: <name> does not existDown. The poll succeeded; the name is not there.
<name> exists but has no <TYPE> recordsDown.
<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.

Verification ​

AGPL-3.0-only