Initial Impact: Phantom 404s and Silent Delivery Failures
shop.example.com to point to an e-commerce platform hosted at shops.myshopify.com, or configures an MX record pointing to an enterprise spam filter.
Within minutes of updating the record, users trying to access shop.example.com report that the site cannot be found. Browsers display DNS_PROBE_FINISHED_NXDOMAIN or ERR_NAME_NOT_RESOLVED. In other instances, browsers connect to the web server hosting the apex domain (example.com) rather than the external provider, triggering SSL certificate name mismatch warnings (SSL_ERROR_BAD_CERT_DOMAIN) or generic 404 Not Found pages generated by the local web server.
In email configurations, omitting the dot on an MX target leads to an immediate drop in inbound mail. Remote mail transfer agents (MTAs) attempt to deliver messages to non-existent hosts, causing sender mail queues to back up with deferral messages stating that the recipient domain has no valid mail exchanger.
Investigation Timeline: Tracing the Resolution with dig
8.8.8.8 or 1.1.1.1 can obscure the underlying record syntax because intermediate caches may hold stale negative responses. The investigation must query the authoritative nameservers directly.
Running a standard lookup against the authoritative server reveals the exact data the zone is publishing to the internet.
BASH
dig CNAME shop.example.com @ns1.example.com +noall +answerTEXT
shop.example.com. 300 IN CNAME shops.myshopify.com.example.com.shops.myshopify.com., but shops.myshopify.com.example.com..
Because the authoritative server returns shops.myshopify.com.example.com., the client resolver attempts to resolve that chained name. Unless the organization has a wildcard record (*.example.com) configured in the same zone, the recursive resolver queries for shops.myshopify.com.example.com and receives an NXDOMAIN (Non-Existent Domain) response from the authoritative nameservers. If a wildcard A record does exist, the request resolves back to the origin server's IP address, causing the web browser to request the external hostname from a server that has no virtual host configured for it.
The Critical Discovery: RFC 1035 Zone Mechanics and $ORIGIN
.), which represents the unnamed DNS root zone.
A relative domain name does not end with a trailing dot. Whenever a zone parser encounters a relative domain name in either the name field or the data field of a record, it automatically appends the current zone origin, governed by the $ORIGIN directive.
Consider how a standard zone file defines its records:
TEXT
$ORIGIN example.com.
$TTL 3600
; Broken configuration: relative target
shop IN CNAME shops.myshopify.com
; Correct configuration: fully qualified domain name with trailing dot
store IN CNAME shops.myshopify.com.shops.myshopify.com. Because there is no terminal dot, the parser applies the origin expansion rule:
Target = Label + "." + $ORIGIN
This evaluates to shops.myshopify.com.example.com..
The same rule applies to the left-hand label. The record name shop lacks a trailing dot, so the parser expands it to shop.example.com., which is the intended behavior. The parsing logic that makes it convenient to write short hostnames on the left side of the file silently breaks hostnames pointing outside the zone on the right side.
| Record Type | Intended Target | Syntax Used in Zone | Resulting Parsed Record |
|---|---|---|---|
| CNAME | target.cdn.net. | target.cdn.net | target.cdn.net.example.com. |
| MX | mail.protection.outlook.com. | mail.protection.outlook.com | mail.protection.outlook.com.example.com. |
| NS | ns1.externaldns.com. | ns1.externaldns.com | ns1.externaldns.com.example.com. |
| PTR | host.example.com. | host.example.com | host.example.com.in-addr.arpa. |
Temporary Mitigation: Clearing Resolvers and Managing Negative TTL
shops.myshopify.com.example.com., the authoritative nameserver returns an NXDOMAIN response alongside the zone's Start of Authority (SOA) record.
Under RFC 2308, recursive resolvers cache negative responses to prevent clients from overwhelming authoritative servers with repeated queries for broken names. The duration of this negative cache is dictated by the MINIMUM field in the zone's SOA record or the TTL of the SOA response itself.
If the zone sets a negative caching TTL of 3600 seconds, downstream recursive resolvers (including public services and local ISP caches) will remember that the target does not exist for up to one hour, even if the authoritative record is corrected five seconds later.
To restore service quickly during an incident:
- Correct the target record in the authoritative zone file or control panel.
- Query the authoritative server directly to ensure it serves the corrected FQDN.
- Flush downstream public resolvers using their respective cache clearing interfaces (such as Google Public DNS Flush Cache or Cloudflare Purge Cache) for both the subdomain and the malformed appended domain.
- Flush local client resolver caches if internal testing still yields negative responses.
Architectural Fix: CI/CD Linters and Control Plane Discipline
named-checkzone utility parses master files and flags syntax inconsistencies.
BASH
named-checkzone example.com /var/named/zones/db.example.comnamed-checkzone will permit external relative CNAMEs because they are technically valid according to RFC syntax, modern infrastructure-as-code (IaC) tooling allows strict linting rules. For teams using Terraform, OctoDNS, or DNSControl, apply automated policy checks that enforce explicit rules on record definitions:
- All CNAME, MX, and NS targets pointing to domains outside the current origin must terminate with a period (
.). - Pre-commit hooks should parse zone files or configuration blocks using regular expressions or schema validators to verify that external hostnames match
.*\.[a-zA-Z0-9-]+\.$. - Where possible, manage DNS records using APIs or providers that validate target fully qualified domain names at submission time.
dig. Seeing your own apex domain unexpectedly tagged onto the end of a third-party hostname is the definitive signature of a missing trailing dot.