Uptime monitors

DNS monitors

A DNS monitor asks the authoritative nameservers for one record of a domain name, for example the A record of example.com. The check passes when the record exists and, if you set expected values, the answer matches them. Use it to find DNS mistakes, expired zones and records that someone changed.

Add a DNS monitor

  1. In the sidebar, select Monitors.
  2. Select Create monitor.
  3. Under Type, select DNS.
  4. In Target, enter the domain name, for example example.com or _dmarc.example.com.
  5. Under Record, select the record type.
  6. In Expected values, enter the values the answer must have, one per line. This is optional.
  7. Select Create and start.

What a check does

  1. The Spectate checker sends a query for the record type over UDP. If the answer is truncated, it asks again over TCP.
  2. It reads the records of that type from the answer.
  3. If the monitor has expected values, it compares them with the answer.

The check fails if any of these is true:

  • The response code is not NOERROR, for example NXDOMAIN or SERVFAIL. The error is dns rcode NXDOMAIN.
  • The answer has no records of the type. The error is no A records for example.com.
  • The answer does not match the expected values.
  • The query takes longer than Timeout.

Record types

RecordValue format in the answerExample
AIPv4 address203.0.113.10
AAAAIPv6 address2001:db8::10
CNAMEHost nametarget.example.net
MXPreference and host10 mx.example.com
NSHost namens1.example.net
TXTThe text, with the strings joinedv=spf1 include:_spf.example.com ~all
CAAFlag, tag and value0 issue "letsencrypt.org"
SOAPrimary name server, mailbox and serialns1.example.net hostmaster.example.com 2026102201

Enter expected values in the same format. The default record type is A.

Expected values and matching

Match decides how Spectate compares the answer with Expected values:

MatchAPI valueThe check passes when
Answer contains every valuecontainsEvery expected value is in the answer. The answer can have more values.
Answer is exactly these valuesexactThe answer has the expected values and no others, in any order.

The comparison ignores upper and lower case and a dot at the end of a name. Quotes around a TXT value are optional. You can enter up to 20 values, each up to 512 characters. Without expected values, any answer with at least one record of the type passes.

Authoritative nameservers and resolvers

A new DNS monitor asks the authoritative nameservers of the zone directly. The answer skips resolver caches, so you see a change or a problem as soon as it happens.

The check finds the nameservers of the zone and asks them in alphabetical order of host name. If a nameserver does not answer, refuses or fails, the check asks the next one, up to 4. If the answer is a CNAME, the check asks the authoritative nameservers of the target, as a resolver does.

To use a resolver instead, open the DNS query section of the settings and clear Ask the authoritative nameservers. Then you can set Resolver:

  • Enter a public resolver, as an IP address with an optional port, for example 1.1.1.1 or 9.9.9.9:53.
  • Leave it empty to use the checker's own resolver.

A resolver can answer from its cache. The response time is then not the time of your nameservers. A change or a dead nameserver can also stay hidden until the record's TTL ends. The monitor page shows resolver, may be cached for these monitors.

DNS monitors created before this default keep their setting. Spectate does not query private or reserved addresses.

Check every nameserver of the zone

Ask the authoritative nameservers stops at the first nameserver that answers, so a dead second nameserver goes unnoticed. Select Check every authoritative nameserver to ask all of them. This option includes Ask the authoritative nameservers.

The check finds the zone of the record and its nameservers through the checker's resolver. It then asks up to 12 nameservers at the same time, in alphabetical order of host name. Each nameserver gets a SOA query over UDP with recursion off, a SOA query over TCP and a query for the monitored record.

The monitor uses the answer of the first nameserver that answers authoritatively for Expected values and DNS answer changes.

The monitor goes down only in these cases:

What happenedError
The zone has no nameserversno name servers found for example.com
No nameserver answers authoritativelyno nameserver of example.com answered authoritatively: ns1.example.com (no answer), ns2.example.com (REFUSED)
The monitored record failsThe errors in What a check does

A problem with one nameserver leaves the monitor up. The other nameservers still answer, so the zone still resolves. Spectate fires a separate alert for each problem and each nameserver:

ProblemSeverityAlert title
A nameserver does not respond, has no address or has a private addressmediumNAME: nameserver ns2.example.com is unreachable
A nameserver responds without an authoritative answer, for example without the AA flagmediumNAME: nameserver ns2.example.com isn't authoritative
Nameservers give different answers for the monitored recordmediumNAME: nameservers give different answers
SOA serials differ for 30 minutesmediumNAME: nameservers have different serials
The parent zone lists other nameservers than the zonemediumNAME: the parent zone lists other nameservers
The zone lists other nameservers than Expected nameserversmediumNAME: the zone lists unexpected nameservers
A query over TCP failslowNAME: ns2.example.com doesn't answer over TCP
The RRSIG on the SOA expires within 3 daysmediumNAME: the SOA signature expires soon
The RRSIG on the SOA has expiredhighNAME: the SOA signature has expired

Spectate fires each of these alerts when two checks in a row find the problem. A successful check without the problem resolves the alert. A failed check does not change these alerts, because the critical alert of the monitor covers that case.

The DNSSEC alerts look at signature expiry only, and only if the zone returns RRSIG records. Spectate does not validate the chain of trust.

Expected nameservers is optional. Enter the host names the zone must list, one per line. The monitor page shows a Nameservers table with the result of the latest check for each nameserver.

Alert when the answer changes

Under Alerting, turn on DNS answer changes to get an alert when the answer is different from the answer of the previous check. Spectate fires the alert even when the new answer still matches the expected values.

Spectate compares with the last successful check, so it also finds a change during an outage. The alert has the severity low and the title "DNS records changed for NAME". It shows the old and the new answer. This alert does not resolve on its own. While it fires, later changes do not fire a second alert. Resolve it on the alert page after you check the change.

Settings reference

Dashboard labelAPI fieldDefault
Targeturi
Record or Record typeadvanced_settings.dns_record_typeA
Expected valuesadvanced_settings.dns_expected_valuesNone
Matchadvanced_settings.dns_matchcontains
Resolveradvanced_settings.dns_resolverNone. Used when Ask the authoritative nameservers is off; empty uses the checker's resolver.
Ask the authoritative nameserversadvanced_settings.dns_authoritativeOn for new monitors, unless the API request sets dns_resolver
Check every authoritative nameserveradvanced_settings.dns_check_all_nameserversOff
Expected nameserversadvanced_settings.dns_expected_nameserversNone. Up to 20 host names
DNS answer changesadvanced_settings.dns_alert_on_changeOff