What is ANAME?
ANAME or alias record, enables the root record (apex) of a domain to be pointed to a Fully Qualified Domain Name. For example, this will allow you to point yourdomain.com to another domain so the requests will go to the same server that the other domain points to.
How does ANAME work?
- A user requests yourdomain.com.
- The request hits the authoritative name servers.
- The name servers locate the ANAME record for yourdomain.com, which points to hostname.com.
- Another lookup takes place, but for the domain that you are pointing yourdomain.com to, in this case, hostname.com.
- Hostname.com, the alias of yourdomain.com, resolves to the IP 125.34.45.322. That IP is retrieved in the lookup mentioned in the previous step.
- ANAMEs will return the IP address(es) that the hostname resolves to as A record(s). In more traditional implementations of ANAME, the system will store the record(s) for some time to be returned for other requests. In Constellix, we do Real-Time lookups so we do not store the IP(s).
Why use ANAME?
- CNAME limitation
If you are familiar with CNAMEs, you may already know that per RFC standards, they must be a unique record within the zone file, which means that if you already have a CNAME record of that points to domain2.com, you would not be able to create any other record of any other type with name domain1.com. Thus, using an ANAME will allow you to have multiple records for the root, such as MX, NS, SOA or TXT records.
- Content Delivery Networks (CDN)
If you use a CDN, you can use ANAME records to point the root of your domain to the appropriate CDN.
- DDoS Mitigation & Protection Services
If you use more than one CDN provider simultaneously, you can create multiple ANAME records for domain.com pointing to different values. In Constellix, this would be handled by using an ANAME Pool instead of requiring a costly physical load balancer. In this case, you would have a load balancer, because both CDNs are receiving traffic for that domain at the same time. In case there is an outage at CDN #1, traffic will still be handled by CDN #2, providing redundancy and availability for your domain.
- Masking FQDN
You can mask your domain name when using an ANAME record. So when you create the ANAME record of domain1.com pointing to domain2.com, the user requesting the FQDN will see domain1.com in the URL.