What Is an ALIAS Record?

Last updated

Table of Contents


What is an ALIAS record?

An ALIAS record points your root domain (like example.com) to a hostname, such as a Heroku app or an AWS Elastic Load Balancer. DNSimple created the ALIAS record type as part of DNS hosting at DNSimple, because a CNAME record cannot be used on a root domain.

An ALIAS record works like a dynamic A record. Instead of storing a fixed IP address, it looks up the current IPv4 (A) or IPv6 (AAAA) addresses of the hostname you specify when your domain is queried. The resolver that asked gets those addresses back as regular A or AAAA records on your domain.

CNAME limitations at the apex

Under RFC 1034, a name that has a CNAME record cannot have any other records. That rules out MX records for email, NS records for name servers, and A records at the same name.

A root domain needs NS and SOA records to work, and usually MX records too. Those records cannot exist alongside a CNAME, so a CNAME cannot be used at the apex.

An ALIAS record points the root domain to a hostname and leaves your other DNS records in place. Use it for services that change their IP addresses, such as CDNs, cloud platforms, and load balancers, where a static A record would go out of date.

How ALIAS records work

Dynamic resolution process

DNSimple name servers run erl-dns, an open-source Erlang DNS server, with custom handlers added. The ALIAS handler does the dynamic lookup.

When a query arrives for a domain with an ALIAS record:

  1. The handler asks a local PowerDNS resolver for the current IPv4 or IPv6 addresses of the hostname in your ALIAS record (something like myapp.herokuapp.com).
  2. If that lookup succeeds, the handler takes the A and AAAA records from the answer.
  3. erl-dns returns those addresses to the resolver that asked. To that resolver, your domain looks like it has static A or AAAA records.

Performance and reliability

DNSimple keeps each successful ALIAS lookup in an in-memory cache. When the same record is queried again, the name server returns the cached answer instead of doing another lookup.

Each lookup attempt has 500 milliseconds to complete. If an attempt times out, DNSimple checks the in-memory cache again and returns a cached answer if one is available. If there is no cached answer, DNSimple tries the lookup one more time.

If both attempts fail, or the resolver reports an error for the target, DNSimple name servers answer with SERVFAIL. This status tells resolvers the answer is temporarily unavailable, so they retry the query, often against another DNSimple name server, instead of caching an empty result. Your ALIAS record resolves again as soon as the target is reachable.

If the ALIAS target returns NXDOMAIN (the name does not exist), DNSimple answers with an empty response for the A or AAAA query rather than NXDOMAIN. Other records on the same name, such as MX or TXT records, keep working. You can check which status a query returns with dig.

For the record format and limits, see ALIAS Record Reference. If you also use secondary DNS, see How ALIAS Records Resolve with Secondary DNS.

Have more questions?

If you have additional questions or need any assistance with your ALIAS records, contact support, and we will be happy to help.