ALIAS / ANAME Records

Virtual records that allow CNAME-like behavior for your domain's root.

What is an ALIAS Record?

An ALIAS record (also known as an ANAME record) is a virtual record type that provides CNAME-like functionality where CNAME records are not allowed by DNS standards-specifically at the root (apex) of a domain. It's not a true DNS record, but rather a feature provided by many modern DNS hosting services.

Why Do We Need ALIAS?

DNS RFCs state that a CNAME record cannot coexist with any other record for the same name. Since the root domain (e.g., mysite.com) must have SOA and NS records, you cannot put a CNAME there. ALIAS records solve this problem.

How It Works

When you create an ALIAS record, your DNS provider doesn't actually publish a record called "ALIAS". Instead, their nameservers perform a server-side lookup of the target domain and return the resulting A or AAAA record directly to the user.

  1. User requests example.com.
  2. Your nameserver sees an ALIAS record pointing to myapp.herokuapp.com.
  3. The nameserver resolves myapp.herokuapp.com to 1.2.3.4.
  4. The nameserver returns example.com A 1.2.3.4 to the user.

ALIAS vs. CNAME

  • CNAME: Returns the target domain name to the user. The user's browser must then perform a second lookup. Cannot be used at the root.
  • ALIAS: Returns the IP address of the target directly. Can be used anywhere, including the root domain.

Common Use Case: Root Domain on Cloud Hosting

If you're using a service like a Load Balancer (AWS ELB), a CDN, or a PaaS (Heroku, Netlify), they often provide a long hostname rather than a static IP. To point your root domain to these services, you must use an ALIAS record if you want it to work correctly.