# Troubleshooting DNS

Symptoms you can hit with hosted zones, their causes, and the fix.

## The delegation check says Elsewhere

**Cause:** The registrar still names other nameservers for the domain ("The domain is served by
other nameservers. Replace them at the registrar."), or names the platform nameservers next to old
ones ("Some NS records still name other servers; resolvers will use them part of the time.").

**Fix:** Replace every `NS` record at the registrar with the platform nameservers, then choose
**Check now** again after a few minutes (see [Delegate a domain](delegate-a-domain.md)).

## The delegation check says Pending

**Cause:** The domain has no `NS` records that public resolvers return yet ("The domain has no NS
records yet, or the registrar has not published them."), or the lookup failed ("Lookup failed (…);
try again in a minute.").

**Fix:** Wait for the registrar to publish the change, then check again.

## The domain is delegated, but a name does not resolve

**Cause:** The record is missing, or a resolver still holds a negative answer from before.

**Fix:** Add the record. Negative answers are cached for up to 60 seconds.

## A new or changed record is not answered yet

**Cause:** The nameservers answer a change from their next pull, and resolvers keep a cached answer
until its TTL runs out.

**Fix:** Ask a platform nameserver directly (`dig @<nameserver> www.example.com`): it has the change
with its next pull, seconds later. Resolvers follow when the old TTL has passed. Lower the TTL before a planned
change.

## Adding a CNAME is refused although it would replace one

**Cause:** "… already has other records; a CNAME must be the only record at its name" also counts an
existing `CNAME` at the name.

**Fix:** Edit the existing `CNAME` instead of adding one (see
[Edit or delete a record](edit-or-delete-a-record.md)).

## An import fails on one line

**Cause:** Every line must validate before anything is written. The `400` reads "Nothing imported:
line …: …", for example `unsupported record type "PTR"` or `… is outside example.com`, or "Nothing
imported: … has a CNAME next to other records".

**Fix:** Fix or remove the lines the error names; it names up to five and counts the rest as
"(+… more)".

## An app's custom domain in the zone has no certificate yet

**Cause:** The zone is not delegated to the platform nameservers yet, so the certificate authority
cannot reach the name, or the domain was added before the zone existed and has no record in it.

**Fix:** Look at the app's domains panel. Each domain shows what DNS answers and why the certificate
is not issued. A name your zone answers reads "Answered by your hosted zone _zone_, nothing to
create", with the zone's delegation status next to it; otherwise the panel says "Add this record in
your hosted zone _zone_" and names the record.

## A signed zone fails to resolve at validating resolvers

**Cause:** The DS at the registrar does not match an active key-signing key of the zone: the key was
rolled and the DS not replaced, or DNSSEC was turned off completely and on again, which made new
keys.

**Fix:** Compare **DS record for the registrar** on the zone's **DNSSEC** tab with the DS at the
registrar, and replace it. If the registrar's DS cannot be fixed quickly, remove it there.

## `dig +dnssec` shows no `ad` flag

**Cause:** The parent zone has no DS for the zone, or the resolver you asked does not validate.

**Fix:** Put the DS at the registrar, and ask a validating resolver such as 1.1.1.1.

## A name that does not exist answers NOERROR, not NXDOMAIN

**Cause:** The zone is signed, and a signed zone denies a name with a compact answer: `NOERROR`
with an `NSEC` record listing `NXNAME`.

**Fix:** Nothing: it means the name does not exist, and resolvers treat it so. A client that sets
the `CO` flag gets `NXDOMAIN`.

## A geolocation set answers its default everywhere

**Cause:** The resolver sends no EDNS Client Subnet, so the client is located where the resolver
is, and that country and continent have no variant.

**Fix:** Expected. To test a location, ask a platform nameserver with a client subnet from that
location: `dig +subnet=<network>/24 @<nameserver> www.example.com`.

## Related

- [How the nameservers answer](how-the-nameservers-answer.md)
