What Is an ALIAS Record
Learn how ALIAS records enable CNAME-like functionality at the root domain. Includes examples for the DNScale dashboard and API.
What you'll learn
- Understand why CNAME records cannot be used at the apex domain and how ALIAS solves this limitation
- Explain how server-side resolution (CNAME flattening) works at the authoritative DNS level
- Compare ALIAS records with A, CNAME, and HTTPS records for apex domain configuration
- Evaluate provider-specific considerations and DNSSEC implications when using ALIAS records
An ALIAS record (also known as ANAME or CNAME flattening) provides CNAME-like functionality at the root (apex) domain. While standard CNAME records cannot be used at the apex, ALIAS records solve this limitation by automatically resolving the target to IP addresses.
Why ALIAS Records Exist
DNS standards prohibit CNAME records at the apex because CNAME cannot coexist with other record types, and every zone requires SOA and NS records at the apex.
The problem:
# NOT ALLOWED - CNAME at apex
example.com. CNAME myapp.cloudprovider.com.
# ALLOWED - CNAME at subdomain
www.example.com. CNAME myapp.cloudprovider.com.The solution:
# ALLOWED - ALIAS at apex
example.com. ALIAS myapp.cloudprovider.com.This is the core reason ALIAS records were invented. Modern cloud platforms and CDNs typically provide hostnames rather than static IP addresses. Without ALIAS, pointing an apex domain to these services requires manually maintaining A records with IP addresses that may change at any time.
For a detailed comparison of when to use each record type, see CNAME vs A Record.
How ALIAS Records Work
ALIAS records work differently from CNAME:
- CNAME: Returns the target hostname; client resolves it
- ALIAS: DNS server resolves the target and returns IP addresses
# Client queries example.com
# DNS server internally resolves myapp.cloudprovider.com
# Client receives A/AAAA records directly
example.com. ALIAS myapp.cloudprovider.com.
# Client sees:
example.com. 300 A 192.0.2.1
example.com. 300 A 192.0.2.2This "flattening" happens at the authoritative DNS server, making the ALIAS transparent to clients. From the resolver's perspective, the response looks exactly like a normal A record or AAAA record response. No special client support is needed.
The term "CNAME flattening" comes from this behavior: the CNAME-like chain is "flattened" into a direct address response by the authoritative server.
ALIAS vs CNAME: Key Differences
While both ALIAS and CNAME point to another hostname, their behavior differs in important ways:
| Feature | CNAME | ALIAS |
|---|---|---|
| Works at apex | No | Yes |
| Coexists with other records | No | Yes |
| Resolution happens at | Resolver (client-side) | Authoritative server |
| Visible to clients | Yes (CNAME in response) | No (looks like A/AAAA) |
| Standards-based | Yes (RFC 1034) | No (provider-specific) |
| Extra latency | Client resolves target | Server resolves target |
For subdomains, standard CNAME is usually the better choice because it is universally supported and lets the resolver cache the CNAME chain independently. ALIAS is specifically designed for the apex domain problem.
Common Use Cases
Apex Domain to CDN
Point root domain to Cloudflare, AWS CloudFront, or other CDNs:
example.com. 3600 ALIAS cdn.cloudprovider.com.CDNs use anycast routing to serve content from geographically distributed edges. The ALIAS record follows the CDN's DNS resolution, which may return different IPs based on the querier's location, supporting global DNS resolution balancing.
Apex to Cloud Platform
Point root domain to Heroku, Netlify, Vercel, etc.:
example.com. 3600 ALIAS myapp.herokuapp.com.
example.com. 3600 ALIAS mysite.netlify.app.
example.com. 3600 ALIAS myproject.vercel.app.Apex to Load Balancer
Point root domain to AWS ELB/ALB:
example.com. 3600 ALIAS my-lb-123456.us-east-1.elb.amazonaws.com.Combined with CNAME for www
; Apex uses ALIAS
example.com. 3600 ALIAS myapp.cloudprovider.com.
; www uses standard CNAME
www.example.com. 3600 CNAME myapp.cloudprovider.com.This is a common pattern: ALIAS at the apex for CNAME-like behavior, and a regular CNAME on www since it is a subdomain and has no restriction. Both point to the same target, ensuring consistent behavior whether visitors use example.com or www.example.com.
ALIAS vs CNAME vs A Record
| Feature | A Record | CNAME | ALIAS |
|---|---|---|---|
| Points to | IP address | Hostname | Hostname |
| Works at apex | Yes | No | Yes |
| Coexists with other records | Yes | No | Yes |
| Target IP changes | Manual update | Automatic | Automatic |
| Standard DNS | Yes | Yes | No (provider-specific) |
Record Format
| Field | Description | Example |
|---|---|---|
| Name | Domain (typically apex) | @ |
| Type | Record type | ALIAS |
| Content | Target hostname | myapp.cloudprovider.com. |
| TTL | Time to live (seconds) | 3600 |
Adding an ALIAS Record
Using the Dashboard
- Navigate to your zone in the DNScale dashboard
- Click Add Record
- Configure the record:
- Name: Use
@for apex domain - Type: Select
ALIAS - Value: Enter the target hostname
- TTL: Set the cache duration (default: 3600)
- Name: Use
- Click Create Record
Using the API
Create an ALIAS record:
curl -X POST "https://api.dnscale.eu/v1/zones/{zone_id}/records" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "@",
"type": "ALIAS",
"content": "myapp.cloudprovider.com",
"ttl": 3600
}'Point apex to AWS CloudFront:
curl -X POST "https://api.dnscale.eu/v1/zones/{zone_id}/records" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "@",
"type": "ALIAS",
"content": "d1234567.cloudfront.net",
"ttl": 300
}'Point apex to Vercel:
curl -X POST "https://api.dnscale.eu/v1/zones/{zone_id}/records" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "@",
"type": "ALIAS",
"content": "cname.vercel-dns.com",
"ttl": 3600
}'API Response:
{
"status": "success",
"data": {
"message": "Record created successfully",
"record": {
"id": "encoded-record-id",
"name": "example.com.",
"type": "ALIAS",
"content": "myapp.cloudprovider.com.",
"ttl": 3600,
"disabled": false
}
}
}How DNScale Resolves ALIAS Records
When a client queries an ALIAS record:
- Client asks DNScale for
example.com - DNScale sees ALIAS pointing to
target.provider.com - DNScale resolves
target.provider.com(gets IPs) - DNScale returns those IPs as A/AAAA records for
example.com
This resolution happens in real-time, so IP changes at the target are automatically reflected. DNScale resolves both IPv4 and IPv6 addresses, returning A and AAAA records as appropriate. For details on IPv4 vs IPv6 considerations, see IPv6 vs IPv4.
TTL Behavior
ALIAS record TTL affects how often DNScale re-resolves the target:
- Short TTL (300s): More frequent updates, follows target changes quickly
- Long TTL (3600s): Less DNS traffic, but slower to reflect changes
The TTL returned to clients is typically the minimum of:
- Your ALIAS TTL setting
- The target's actual A/AAAA record TTL
For guidance on choosing TTL values, see DNS TTL Best Practices.
Provider Support
Because ALIAS is not a standardized DNS record type, different providers implement it differently:
| Provider | Name | How It Works |
|---|---|---|
| DNScale | ALIAS | Server-side resolution |
| Cloudflare | CNAME Flattening | Automatic for apex CNAME |
| AWS Route 53 | Alias (AWS-specific) | Only for AWS resources |
| DNSimple | ALIAS | Server-side resolution |
| NS1 | Linked records | Server-side resolution |
If you are using multi-provider DNS, be aware that ALIAS behavior may differ between providers. A record that works in DNScale may need a different configuration at another provider. For portability, you can also manage ALIAS records through the DNScale Terraform provider or DNSControl.
Limitations
-
Provider-specific -- ALIAS is not a standard DNS record type; implementation varies by provider
-
Single value -- Like CNAME, only one ALIAS record per name
-
Resolution latency -- Initial queries may be slightly slower while target is resolved
-
DNSSEC considerations -- The flattened response loses the target's DNSSEC chain. DNScale signs the flattened A/AAAA response with your zone's DNSSEC keys, so the response is authenticated, but the chain of trust from the target domain is not preserved.
-
IPv4/IPv6 handling -- DNScale returns both A and AAAA if the target has both
Best Practices
-
Use for apex only -- For subdomains, standard CNAME is usually better
-
Verify target is valid -- Ensure the target hostname resolves correctly before creating the ALIAS
-
Consider HTTPS records -- For modern browsers, HTTPS records may be a better option for apex web services
-
Use shorter TTLs -- Shorter TTLs ensure faster propagation of target IP changes
-
Monitor resolution -- Check that ALIAS records are resolving to expected IPs
-
Maintain TXT records separately -- ALIAS coexists with TXT, so your SPF, DKIM, and DMARC records work normally at the apex
ALIAS vs HTTPS Record at Apex
For web services, you have two options at the apex:
| Scenario | Recommended |
|---|---|
| General apex aliasing | ALIAS |
| Modern browsers with HTTP/3 | HTTPS (priority 0) |
| Both older and modern clients | ALIAS + HTTPS |
; Combined approach
example.com. 3600 ALIAS cdn.provider.com.
example.com. 3600 HTTPS 0 cdn.provider.com.The ALIAS ensures all clients can reach the site, while the HTTPS record enables modern browsers to use HTTP/3 and other optimizations from the first connection.
Testing ALIAS Records
Since ALIAS records are flattened, you'll see A/AAAA records in the response:
# Query the domain - you'll see A records, not ALIAS
dig example.com A
# Check for both A and AAAA
dig example.com A +short
dig example.com AAAA +short
# Verify the resolved IPs match the target
dig myapp.cloudprovider.com A +short
# To verify the ALIAS configuration, use the DNScale dashboard
# or query the API to list recordsRelated Record Types
- CNAME -- Standard aliasing (subdomains only)
- A -- Direct IPv4 mapping
- AAAA -- Direct IPv6 mapping
- HTTPS -- Modern alternative for web services
- SVCB -- General service binding
- NS -- Nameserver delegation
- DNS Record Types -- Overview of all DNS record types
Conclusion
ALIAS records solve the apex domain aliasing problem that has long plagued DNS configuration. By automatically resolving target hostnames to IP addresses, ALIAS records give you the flexibility of CNAME at the root domain. DNScale's ALIAS support makes it easy to point your apex domain to CDNs, cloud platforms, and load balancers without manually managing IP addresses.
Ready to manage your DNS with confidence?
DNScale provides anycast DNS hosting with a global network, real-time analytics, and an easy-to-use API.
Start free