Skip to content

ALIAS / ANAME records — what to do when cPanel does not support them natively

cPanel uses BIND which has no ALIAS/ANAME type. When a CDN demands a CNAME at the apex, here are the practical workarounds on a cPanel-hosted zone.

A customer’s CDN provider’s onboarding doc says “create an ALIAS record at the apex pointing to cdn.provider.net”. cPanel’s Zone Editor doesn’t have an ALIAS record type. The customer tries to make it a CNAME, gets the “CNAME at apex” error, and asks why hosted DNS providers have something cPanel doesn’t. The answer is that ALIAS is a vendor extension, not a DNS record type — and there are three practical workarounds.

What’s happening

DNS standardizes A, AAAA, CNAME, MX, TXT, NS, SOA, SRV, CAA, and a handful of others. ALIAS and ANAME are not in any RFC — they’re invented record types implemented by specific DNS providers (Cloudflare, Route 53, DNSimple, several others). The way they work: the provider’s nameserver receives a query for the apex, resolves the target name itself (server-side), and returns the resolved A/AAAA to the client. From the client’s perspective, the apex has a normal A record. The “alias” lives only in the provider’s configuration.

cPanel uses BIND, which has no ALIAS implementation. The zone is a flat list of standard records. If you need a CDN at the apex, you cannot just write “ALIAS” anywhere — the resolution has to happen somewhere, and that somewhere is either an automated A-record refresher, a different DNS provider, or a redirect strategy.

How to verify

Confirm cPanel/BIND doesn’t support ALIAS:

named -V | head -1
grep -i alias /etc/named.conf

There’s no ALIAS in BIND’s syntax. The cPanel Zone Editor’s dropdown does not include ALIAS.

Confirm the target CDN’s actual resolution:

dig +short cdn.provider.net A
dig +short cdn.provider.net AAAA

These are the IPs you would publish manually under workaround 1.

What to do

Pick one of three workarounds:

1. Automated A-record refresher.

Run a cron that re-resolves the CDN’s target and updates the zone’s A record when it changes:

#!/bin/bash
TARGET="cdn.provider.net"
ZONE="example.com"
CURRENT=$(dig +short A example.com | head -1)
NEW=$(dig +short A $TARGET | head -1)
if [ "$CURRENT" != "$NEW" ] && [ -n "$NEW" ]; then
  whmapi1 editzonerecord domain=$ZONE Line=N name=example.com. ttl=300 type=A address=$NEW
  /scripts/dnscluster synczone $ZONE
fi

Run every 5 to 15 minutes. Set TTL to 300 so resolvers update quickly when the script flips the record.

Caveat: if the CDN returns multiple IPs and rotates, you’re picking one. That’s fine if the CDN has consistent latency across its IPs, problematic if it doesn’t.

2. Move the apex to a DNS provider that supports ALIAS.

Cloudflare DNS (free or paid), Route 53, DNSimple, or any of the others handle apex aliasing as a feature. The cPanel host keeps the cPanel-bundled DNS for everything else, but for the zones where you need an apex-CDN, delegate that zone to the third-party DNS. NS at the registrar points to Cloudflare/Route 53; those providers serve the zone with their alias feature.

Caveat: you now manage DNS in two places. If you also rely on cPanel’s DNSSEC, you lose it for the delegated zone unless the new provider also supports DNSSEC.

3. Use a redirect from apex to www.

Publish a normal A record at the apex pointing to a small origin that does nothing but issue 301 to https://www.example.com/. The CNAME-to-CDN lives at www, which is a normal subdomain where CNAME is fine. Users who hit example.com get redirected; users who hit www.example.com are served by the CDN.

server {
    listen 80;
    listen 443 ssl;
    server_name example.com;
    return 301 https://www.example.com$request_uri;
}

Caveat: SEO and link-sharing patterns sometimes prefer the apex as canonical. This workaround flips canonical to www. Most sites are fine with this; some aren’t.

Recommendation

For most cPanel-hosted sites, workaround 3 (apex redirect to www) is the cleanest. It’s standards-compliant, doesn’t require a script or a second DNS provider, and survives indefinitely.

For sites where the apex must be canonical (e.g., legacy embed links pointing at the apex), workaround 1 is workable but operationally noisier.

Workaround 2 is the right answer when the customer also wants the CDN provider’s WAF/caching features alongside the alias — Cloudflare DNS combined with their CDN is a common setup.

Stack Harbor implements apex-aliasing strategies as part of deployment management.