Skip to content

doctor dns

Terminal window
holocron doctor dns

Compares the DNS records the config makes setup write with what the dns provider lists for each zone, and prints one row per zone. It changes nothing and exits non-zero while any row fails.

setup and setup notifications write these records. One that is missing, changed by hand or pointing at the wrong target is otherwise found when a preview URL or the relay stops answering.

✗ preview.example.dev records exist 1 problem(s)
- missing record CNAME *.preview.example.dev
✓ example.dev records exist 1 of 1 exist
1 ok, 1 fail, 0 skipped

Only records that can be worked out from the config alone, without asking a provider to create anything:

Record When
CNAME <domain> and CNAME *.<domain> to <project>.pages.dev a deploy, deploy-docs or deploy-components task has a preview domain, on a Cloudflare deployment
the record a wiki provider returns from dnsRecord(), proxied when the wiki proxies a wiki provider is configured
AAAA <relay.host> to 100::, proxied a notifications layout declares a relay; the zone is relay.zone, or the relay’s own
CNAME <docs.domain> to <org>.github.io, DNS-only (GitHub Pages) docs.domain is set
MX <domain> to mx01.mail.icloud.com and mx02.mail.icloud.com, and the SPF TXT doctor: { mail: "icloud" } is set; the zone is domain

The records new domain keeps in .holocron/dns-records.json are expected too, each with its value. A list that cannot be read is a failing row of its own.

A record is found by its type and name (case and a final dot do not matter). The target must match; where the record must be proxied, it must be. A record in the zone that is not expected is never a problem.

Records nothing declares. A record in the zone that no config declares (not one setup writes, not one in .holocron/dns-records.json, not a deployment domain’s) is listed in an information row, dns-undeclared-<zone>, shown as skipped, so it can never fail the run. A record that exists on purpose with no declaration (a vendor’s verification TXT, a mail MX) goes in doctor.manualDnsRecords (names only): "TXT _vercel.example.dev" names one type at that name, a bare "mail.example.dev" every record of that name. Case and a final dot do not matter.

doctor: { manualDnsRecords: ["TXT _vercel.example.dev", "mail.example.dev"] },

A record whose value differs from the declared one (a changed SPF TXT) fails as missing and is also listed here, since the zone’s own value is not declared.

A name can hold several MX or TXT records, so for those two types the value is part of what identifies a record; a TXT value is compared without its quotes.

A record that deployment.ensureCustomDomain() returns is not in the table, because asking for it creates the custom domain at the provider. It has a row of its own, <host> points at the deployment, DNS-only, which reads the target with the provider’s read-only expectedDomainRecord() (Vercel: domains.config()) and then checks that the record exists, points at that target and is not proxied. A proxied record breaks the provider’s certificate issuance, so for Sentinel’s sentinel.theholocron.dev a proxied record fails the row. No token for the provider, or no record it recommends, is a skip.

  • Nothing expected: the one row says none declared.
  • Records expected but no dns provider (or it could not load): each zone’s row is a skip with the reason.
  • No token for the read: that zone is a skip with the message.
  • Any other provider error fails that zone’s row with its message.

This reads the provider’s zone, not the internet: it does not say whether a record has propagated.

The dns provider’s token (for Cloudflare: HOLOCRON_CLOUDFLARE_TOKEN, with Zone:Read and DNS read).

Related: doctor secrets, doctor.