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
- In the sidebar, select Monitors.
- Select Create monitor.
- Under Type, select DNS.
- In Target, enter the domain name, for example
example.comor_dmarc.example.com. - Under Record, select the record type.
- In Expected values, enter the values the answer must have, one per line. This is optional.
- Select Create and start.
What a check does
- The Spectate checker sends a query for the record type over UDP. If the answer is truncated, it asks again over TCP.
- It reads the records of that type from the answer.
- 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 exampleNXDOMAINorSERVFAIL. The error isdns 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
| Record | Value format in the answer | Example |
|---|---|---|
A | IPv4 address | 203.0.113.10 |
AAAA | IPv6 address | 2001:db8::10 |
CNAME | Host name | target.example.net |
MX | Preference and host | 10 mx.example.com |
NS | Host name | ns1.example.net |
TXT | The text, with the strings joined | v=spf1 include:_spf.example.com ~all |
CAA | Flag, tag and value | 0 issue "letsencrypt.org" |
SOA | Primary name server, mailbox and serial | ns1.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:
| Match | API value | The check passes when |
|---|---|---|
| Answer contains every value | contains | Every expected value is in the answer. The answer can have more values. |
| Answer is exactly these values | exact | The 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.1or9.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 happened | Error |
|---|---|
| The zone has no nameservers | no name servers found for example.com |
| No nameserver answers authoritatively | no nameserver of example.com answered authoritatively: ns1.example.com (no answer), ns2.example.com (REFUSED) |
| The monitored record fails | The 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:
| Problem | Severity | Alert title |
|---|---|---|
| A nameserver does not respond, has no address or has a private address | medium | NAME: nameserver ns2.example.com is unreachable |
| A nameserver responds without an authoritative answer, for example without the AA flag | medium | NAME: nameserver ns2.example.com isn't authoritative |
| Nameservers give different answers for the monitored record | medium | NAME: nameservers give different answers |
| SOA serials differ for 30 minutes | medium | NAME: nameservers have different serials |
| The parent zone lists other nameservers than the zone | medium | NAME: the parent zone lists other nameservers |
| The zone lists other nameservers than Expected nameservers | medium | NAME: the zone lists unexpected nameservers |
| A query over TCP fails | low | NAME: ns2.example.com doesn't answer over TCP |
| The RRSIG on the SOA expires within 3 days | medium | NAME: the SOA signature expires soon |
| The RRSIG on the SOA has expired | high | NAME: 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 label | API field | Default |
|---|---|---|
| Target | uri | |
| Record or Record type | advanced_settings.dns_record_type | A |
| Expected values | advanced_settings.dns_expected_values | None |
| Match | advanced_settings.dns_match | contains |
| Resolver | advanced_settings.dns_resolver | None. Used when Ask the authoritative nameservers is off; empty uses the checker's resolver. |
| Ask the authoritative nameservers | advanced_settings.dns_authoritative | On for new monitors, unless the API request sets dns_resolver |
| Check every authoritative nameserver | advanced_settings.dns_check_all_nameservers | Off |
| Expected nameservers | advanced_settings.dns_expected_nameservers | None. Up to 20 host names |
| DNS answer changes | advanced_settings.dns_alert_on_change | Off |