DNAME record

On this page 8

A DNAME record is a DNS resource record that redirects an entire subtree of the domain name space to another domain, so that every name below the owner name is resolved as if it were located under the target name. Among the DNS records used on the Internet, it is the delegation name record defined in RFC 6672, which replaced the original RFC 2672 specification. Where a CNAME aliases exactly one name, a DNAME rewrites the suffix of any number of descendant names with a single entry.

Operators use DNAME when a domain is renamed, when two zones must answer identically, or when a large reverse-mapping tree has to be moved. The record is powerful but subtle: it never applies to its own owner name, it interacts with DNSSEC through synthesized CNAME answers, and it cannot coexist with certain other records at or below the owner.

How DNAME substitution works

A DNAME record works by suffix substitution: when a query name ends with the owner name of a DNAME, the server replaces that suffix with the target and continues resolution. For example, a DNAME at old.example with target new.example turns a query for www.old.example into www.new.example, and mail.eu.old.example into mail.eu.new.example.

The authoritative server returns the DNAME itself and, for compatibility, a synthesized CNAME that maps the specific query name to its rewritten form. Older resolvers that do not understand DNAME simply follow that CNAME. Modern resolvers can cache the DNAME and apply it locally to later queries without asking the authoritative server again, which reduces traffic for large subtrees.

The owner name itself is not redirected. A query for old.example does not follow the DNAME; it is answered from whatever records exist at that exact name, such as SOA, NS or MX. This is the most frequently misunderstood property of the record, and it explains why a DNAME is often paired with ordinary records at the apex.

The following table traces how a single DNAME at old.example treats different query names.

Query nameResultReason
old.exampleNot rewrittenOwner name is excluded
www.old.examplewww.new.exampleOne label below the owner
a.b.c.old.examplea.b.c.new.exampleAny depth is rewritten
xold.exampleNot rewrittenSuffix must match whole labels
old.example.netNot rewrittenDifferent suffix entirely
Effect of a DNAME at old.example pointing to new.example

Record format and placement rules

The DNAME record has resource record type 39 and carries a single field, the target domain name. In zone file syntax it looks like old.example. 3600 IN DNAME new.example., and the target is written as a fully qualified name. The time to live controls how long resolvers may cache both the DNAME and any CNAME synthesized from it.

Placement is constrained by strict coexistence rules. A name may hold only one DNAME, and the subtree below a DNAME must be empty in the same zone, because those names are now defined by the target. The table summarizes which records may share the owner name.

Record typeAllowed at ownerComment
SOA and NSYesCommon at a zone apex
MX and TXTYesOwner name keeps its own data
CNAMENoCNAME excludes all other data
Second DNAMENoOnly one target per owner
DNSSEC recordsYesRRSIG, NSEC and DS as needed
Record coexistence at a DNAME owner name

When a DNAME sits at a zone apex, its interaction with NS records matters: a DNAME at the apex of a delegated zone redirects names below the apex but leaves delegation intact. A DNAME placed at a delegation point in the parent zone is not permitted, because the parent is not authoritative for that name.

DNAME compared with CNAME and ALIAS record

The DNAME, the CNAME and the provider-specific ALIAS record all create aliases, but they act on different scopes and at different stages of resolution. Choosing among them depends on whether one name or a whole tree must move, and whether the apex must be aliased.

MechanismScopeApex useStandardized
DNAMEAll names below ownerYes, owner itself not aliasedYes, RFC 6672
CNAMEExactly one nameNo, conflicts with SOA and NSYes, RFC 1034
ALIAS recordExactly one nameYes, flattened by providerNo, vendor feature
HTTPS record alias modeOne service nameYes, for HTTPS clientsYes, RFC 9460
Comparison of aliasing mechanisms in DNS

The practical consequence is that DNAME complements CNAME rather than replacing it. A complete domain rename typically uses a DNAME for the descendants and either duplicated records or an ALIAS-style mechanism for the apex name, since the DNAME cannot alias its own owner.

Typical deployments of DNAME

DNAME is deployed wherever many names must follow one rule. The clearest use cases are listed below with the reason the record fits better than per-name aliases.

SituationDNAME placementBenefit
Domain rebrandingOld domain apexAll hosts follow the new name
IPv4 reverse delegationClassless in-addr.arpa subtreeMoves reverse names to the operator
IPv6 reverse renumberingip6.arpa prefixNew prefix inherits PTR data
AS112 sinkholingPrivate address reverse zonesRedirects junk queries to empty zones
Internationalized variantsVariant domain apexEquivalent labels resolve alike
Situations where a DNAME is a good fit

The AS112 project is a well-known operational example: under RFC 7535, operators can redirect reverse queries for private address space with a DNAME toward a shared empty zone, so new sinkhole zones can be added without coordinating every anycast server. Registries have also used DNAME for variant labels of internationalized domain names.

DNSSEC behavior and resolver support

Under DNSSEC, the DNAME record is signed like any other RRset, but the synthesized CNAME is not signed. A validating resolver verifies the DNAME signature and then checks that the CNAME correctly follows from it; the CNAME carries no RRSIG and is trusted only through that derivation.

This design keeps signing feasible for unlimited descendant names, but it means validators must implement DNAME-aware validation. Some older validators and middleboxes rejected unsigned CNAMEs and produced SERVFAIL responses. Current major resolvers handle the case correctly, yet operators should still test signed DNAME zones with several resolver implementations before production.

Negative answers require attention as well. Because the subtree below a DNAME is empty in the zone, NSEC or NSEC3 records must prove the DNAME exists rather than claim that a name does not exist. Misconfigured signers have occasionally produced proofs that validators reject.

Common mistakes with DNAME

Most DNAME problems come from expecting it to behave like a CNAME for the whole domain. The frequent errors are:

  • Expecting the owner name to redirect, then finding the bare domain unresolved.
  • Leaving old records below the owner, which the DNAME makes unreachable and which many servers refuse to load.
  • Creating redirection loops, such as two DNAMEs pointing at each other, which resolvers stop after a chain limit.
  • Forgetting mail and certificate checks: SPF, DKIM and CAA lookups follow the rewritten name, so the target zone must publish matching data.
  • Setting a very long TTL before the migration is final, which makes rollback slow.

Stripped to the essentials

A DNAME record is like a forwarding rule for an entire street rather than for one house. If a company moves from one domain to another, it can set a single rule saying that every address ending in the old name should be looked up under the new name instead.

The one catch is that the rule covers everything below the old name, not the old name itself. The main address still needs its own entries. Used carefully, one record replaces hundreds of individual aliases.

Where it is applied

A regional engineering firm merges with a larger partner and must retire its old domain, which has about 240 host names for intranet portals, VPN gateways and project servers. Recreating each name as a CNAME would take days and invite errors, so the DNS team publishes one DNAME at the old domain apex pointing to a dedicated subdomain of the new domain, where all the host records are now maintained.

The team keeps SOA, NS, MX and an A record at the old apex so that the bare domain and incoming mail still work. It starts with a TTL of 300 seconds, tests resolution through three different validating resolvers because both zones are signed with DNSSEC, and raises the TTL to one day after two stable weeks.

The outcome is a migration completed in one afternoon: every old host name resolves through the new zone, and future host changes are made only once, in the new domain.