Skip to content

How-to guide

DNS monitoring: catch DNS changes and failures

When DNS breaks, everything breaks at once: the website, the API, email. DNS checks compare live answers with what you expect and alert the moment they differ.

4 min read12 sectionsUpdated

On this page

Key points

  • Check the records that matter: web (A/AAAA/CNAME), mail (MX), verification and SPF (TXT), delegation (NS).
  • Compare with expected values, so unexpected changes alert, not just failures.
  • Watch domain expiry separately from DNS.
  • Lower TTLs before planned changes.

Which records to watch

RecordExample expectationBreaks if wrong
A / AAAA (apex)example.com → 203.0.113.10Website and API
CNAME (www, app)www → example.cdn-provider.netWebsite via CDN
MXcontains mx1.mail-provider.comIncoming email
TXT (SPF, DMARC)v=spf1 include:... ~allEmail deliverability
NSns1.your-dns-host.com, ns2...Everything, if delegation changes
CAAissuer allowed to issue certificatesCertificate renewals

Why DNS changes go wrong

  • Someone edits the zone during a migration and removes a record still in use.
  • A registrar account is compromised and nameservers are changed (hijacking).
  • A CDN or hosting provider changes the target your CNAME should point to.
  • A domain expires because the card on file expired.

An expected-value check catches all four within minutes. A plain uptime check catches only the ones that break the website, and only after users are affected.

Checking by hand

bash
dig +short example.com A
dig +short www.example.com CNAME
dig +short example.com MX
dig +short example.com TXT
dig +short example.com NS
# ask an authoritative server directly
dig @$(dig +short example.com NS | head -n1) example.com A +short

Alerting

Treat an NS change or an A record pointing somewhere unexpected as critical: it could be a hijack. Treat TXT and MX changes as warnings for the team that owns email. Pair every DNS check with an uptime check on the same hostname, so you see both cause and effect.

In VitalRix

DNS checks confirm a record (A, AAAA, CNAME, MX, TXT, NS) resolves to the expected value, on a schedule, with alerts through your normal channels. Keyword and SSL checks sit alongside. See synthetic monitoring and, if a domain already fails to resolve, DNS_PROBE_FINISHED_NXDOMAIN.

Planning a DNS change safely

  1. A day before, lower the TTL of the records you will change (for example to 300 seconds).
  2. Make the change, then query the authoritative nameservers directly to confirm it.
  3. Update the expected values in your DNS checks at the same time, so the change does not raise a false alarm and a later accidental change still does.
  4. Watch uptime checks on the affected hostnames for an hour.
  5. Raise the TTL again once you are confident.

Do not forget email records

MX, SPF, DKIM and DMARC records are easy to break during a migration, and the result is silent: mail bounces or lands in spam, and nobody notices for days. Add expected-value checks for MX and the TXT records that hold SPF and DMARC.

Frequently asked questions

How often should DNS be checked?

Every 5 to 15 minutes is usually enough; DNS changes are rare, but you want to know within minutes when they happen.

Can DNS monitoring detect hijacking?

It can detect the effect: nameservers or records changing to values you did not expect. Combine it with registrar lock and two-factor authentication on the registrar account.

Check it now, free

  • VitalRix and Opsgenie: Connect VitalRix to Opsgenie with the Alert API: create alerts from uptime, APM and SLO rules, acknowledge and close them on recovery, in the US or EU region.
  • DNS propagation: how long it takes and how to check it: How DNS propagation really works: why TTL decides the wait, how nameserver changes differ, how to check resolvers with dig and how to migrate with no downtime.
  • WordPress monitoring: uptime, speed and errors: Monitor a WordPress site: uptime with content checks, login and admin, Core Web Vitals, PHP errors, plugin updates, SSL expiry and backups.
  • Website monitoring: Monitor a website around the clock: uptime checks with content assertions, Core Web Vitals from real visitors, JavaScript errors, session replay and alerts.
  • Get website down alerts in Slack: Send website down alerts to Slack the right way: channel layout, what goes where, keeping noise down and backing Slack up with on-call paging.
  • What are DORA metrics?: DORA metrics explained: deployment frequency, lead time for changes, change failure rate and time to restore, how to measure each from your tools.

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.