# DNAME record

A DNAME record redirects every name below one name to the same name below another: with old.example DNAME new.example, www.old.example becomes www.new.example. Unlike CNAME, it doesn't affect the name it sits on, only the names under it.

- Record type: DNAME
- Type number: 39
- Used for: Delegation
- How common: Rare
- Defined in: RFC 6672

## Format

```
<name> <ttl> IN DNAME <target name>
```

| Field | What it means | Accepted values |
| --- | --- | --- |
| Name | The top of the subtree being redirected. | A host name. |
| Target | Where the subtree is redirected to. | A host name. |

## Examples

### Renaming a branch of names

```
old.example.com. 3600 IN DNAME new.example.com.
```

mail.old.example.com answers as mail.new.example.com, for every record type. old.example.com itself keeps its own records.

### Reverse DNS delegation

```
0.0.10.in-addr.arpa. 3600 IN DNAME 0.0.10.rev.example.net.
```

A provider moving reverse zones under its own domain.

## TTL

3600 or longer; DNAMEs are usually long-lived.

## Common mistakes

- Expecting the name itself to be redirected. DNAME only covers names below it; add an A or CNAME for the name itself if needed.
- Putting a DNAME and a CNAME at the same name, or any records below a DNAME. Those names can't exist.
- Using DNAME for email aliasing. It renames DNS names, not mailboxes.

## At your DNS host

- Few dashboards offer DNAME. It's mostly used in zone files on self-run nameservers and by registries.

## Questions

### What's the difference between DNAME and CNAME?

CNAME aliases one exact name. DNAME aliases everything below a name, but not the name itself.

## Related

- [CNAME record](https://lemon.domains/dns-records/cname.md)
- [NS record](https://lemon.domains/dns-records/ns.md)
- [PTR record](https://lemon.domains/dns-records/ptr.md)

Interactive version with a record checker and live lookup: https://lemon.domains/dns-records/dname
