Point a Root Domain to a Hostname in Namecheap DNS with ALIAS Records

by Fahim

You deploy an app on CloudFront, Fly.io, or an AWS load balancer, and your host hands you a raw hostname like d1234.cloudfront.net or my-app.fly.dev. You want your root domain (example.com) pointing straight to it. But try dropping a standard CNAME onto @, and Namecheap will either block you or silently blow up your incoming domain email.

Here is how to set up an ALIAS record in Namecheap DNS to route your apex domain to any hostname, why it works without breaking your MX records, and how to verify it from the terminal.

Terminal screen running dig command to verify Namecheap DNS ALIAS record resolution
Terminal screen running dig command to verify Namecheap DNS ALIAS record resolution

The Apex CNAME Dilemma: Why RFC 1912 Breaks Your Domain

Blame DNS standards from the 1980s. Under RFC 1912 Section 2.4, if a CNAME record exists on a node, no other record can exist there. It acts as a total alias, hijacking every query for that exact label.

Your root domain (the @ zone apex) always requires an SOA (Start of Authority) and NS (Nameserver) record so resolvers know where to query. Because those records have to exist at @, standard DNS rules forbid you from placing a CNAME there. If a DNS provider allowed you to do it anyway, your nameserver delegation would break, and any MX records routing mail to Google Workspace or Fastmail would immediately stop resolving.

We hit this problem all the time when breaking down A record vs CNAME at the root domain. When cloud providers dynamically rotate their edge IPs, hardcoding static A records fails. You need a way to track a dynamic hostname at the root without destroying the rest of your DNS zone.

How Namecheap ALIAS Records Work Behind the Scenes

An ALIAS record is a vendor-side trick—not an official IETF record type like A, AAAA, or MX. It is Namecheap’s implementation of CNAME flattening.

When you point an ALIAS record at target.hostingprovider.com, here is what happens under the hood:

  • You map @ to target.hostingprovider.com in Namecheap’s dashboard.
  • A client asks Namecheap’s nameservers for the A or AAAA records for example.com.
  • Namecheap’s authoritative servers query target.hostingprovider.com in the background and grab its current IP addresses.
  • Namecheap hands those resolved IPs straight back to the client as ordinary A records.

The client’s browser or terminal never sees a CNAME record. It just gets standard A records back in a few milliseconds. Because the server returns address records instead of an alias pointer, your MX, TXT, and NS records at the apex remain completely untouched.

Step 1: Audit and Remove Conflicting Apex Records

Before adding the ALIAS record, clear out any existing records mapped to the root. Leaving stale A records or default parking IPs behind causes split routing and bizarre lookup failures.

Head to your Namecheap dashboard, go to Domain List, hit Manage next to your domain, and click the Advanced DNS tab.

Scan the Host Records table for anything where the Host is @. Delete these if present:

  • Any A Record where Host is @ (especially Namecheap’s default parking IP 162.255.119.xxx).
  • Any CNAME Record set to @ (Namecheap usually prevents this, but older zone transfers sometimes have them).
  • Any URL Redirect Record pointing @ anywhere else.

Leave your MX Records and TXT Records alone. Your email routing, SPF rules, and DKIM setups need to stay right where they are—just like the setup we walked through for adding a 2048-bit DKIM TXT record in Namecheap.

Step 2: Add the ALIAS Record in Namecheap Advanced DNS

Once the conflicting apex records are gone, you can add your target hostname.

  1. Under the Advanced DNS tab, click Add New Record at the bottom of the table.
  2. Select ALIAS Record from the Type dropdown.
  3. Enter @ in the Host field.
  4. Paste your target hostname (e.g., myapp.fly.dev, custom.vercel-dns.com, or an AWS ALB DNS address) into the Value field. Do not include http://, https://, or trailing slashes.
  5. Set TTL to Automatic (or 1 min if your host churns IPs frequently while testing).
  6. Click the green checkmark to save.

Here is how a clean zone configuration looks inside Namecheap:

Type Host Value TTL
ALIAS Record @ myapp-balancer-1029.us-east-1.elb Automatic
CNAME Record www myapp-balancer-1029.us-east-1.elb Automatic
MX Record @ mail.protonmail.ch (Priority: 10) Automatic
TXT Record @ v=spf1 include:_spf.protonmail.ch Automatic

Notice that www is separate. Because the apex requires an ALIAS to stay RFC-compliant, but www is an ordinary subdomain without apex constraints, a standard CNAME record works fine for www.

Step 3: Point the WWW Subdomain Correctly

Do not forget your www subdomain. Users still type it, and search crawlers will hit it. You have two options depending on your hosting setup:

  1. CNAME directly to the host: If your origin server or edge layer (Cloudflare, Fastly, etc.) is configured to accept traffic on both domains, add a CNAME Record with Host www and Value set to your target hostname.
  2. Redirect www to apex: If your app only listens on the bare root domain, add a URL Redirect Record with Host www and Value https://example.com set to a 301 Permanent Redirect.

If you run a CDN, stick to the pattern we covered when connecting Namecheap domains to CDNs: pick one primary canonical host and 301-redirect the other to avoid duplicate indexing penalties.

Step 4: Verify DNS Resolution with dig and host

Skip refreshing your browser—local DNS caches and browser socket pools will lie to you. Open a terminal and query Namecheap’s nameservers directly.

Query your domain’s A record using dig:

dig @dns1.registrar-servers.com example.com A +noall +answer

If Namecheap is flattening the record correctly, the answer section will return active A records containing the IP addresses of your upstream host:

; <> DiG 9.18.18-1ubuntu1 <> @dns1.registrar-servers.com example.com A +noall +answer
; (1 server found)
;; global options: +cmd
example.com. 1798 IN A 76.76.21.21
example.com. 1798 IN A 76.76.21.22

Next, confirm your mail routing survived the change by checking MX records:

dig @dns1.registrar-servers.com example.com MX +noall +answer

Your mail server entries should return cleanly alongside their priority weights. If you hit any weird edge cases during setup, check the official Namecheap ALIAS record documentation.

Gotchas: TTL Mismatches, Anycast Latency, and Trailing Dots

ALIAS records solve the root mapping problem, but they bring a few quirks you need to watch out for.

1. The Upstream TTL Disconnect

With an ALIAS record, Namecheap performs recursive resolution on your behalf. If your host (like an AWS ALB) switches IP addresses under load, Namecheap has to re-resolve the upstream hostname before it can update the A records it serves to your visitors.

If your upstream service rotates IPs every 60 seconds, but Namecheap’s resolver caches the old result for 300 seconds, clients can hit dead IPs during that window. For high-churn cloud endpoints, drop your ALIAS TTL in Namecheap down to 1 minute.

2. Accidental Trailing Dots

In raw zone files (BIND), an absolute domain ends with a dot (target.com.). In Namecheap’s web console, pasting a trailing dot can cause validation errors or fail silently during resolution. Leave off the final dot: use myapp.fly.dev, not myapp.fly.dev..

3. DNSSEC Compatibility

If you enable DNSSEC on Namecheap, dynamic ALIAS flattening can occasionally trigger validation issues on strict recursive resolvers. This happens when dynamically generated A records fall out of sync with pre-computed zone signatures. If your domain resolves fine on local networks but fails against public resolvers like Quad9 (9.9.9.9), disable DNSSEC temporarily in the Domain tab to confirm if it is the culprit.

Frequently Asked Questions

Can I use an ALIAS record for a subdomain like api.example.com?

Yes, Namecheap lets you place an ALIAS record on any subdomain. That said, unless that subdomain also requires MX or TXT records, stick with a regular CNAME. A CNAME offloads resolution to the client resolver and avoids unnecessary lookup lag at the authoritative DNS level.

Does an ALIAS record cost extra on Namecheap?

No. ALIAS records are supported on both Namecheap BasicDNS and Namecheap PremiumDNS at no extra charge.

Why does dig show an A record instead of an ALIAS record?

ALIAS is not a public DNS record type. It only exists within Namecheap’s software. Resolvers asking Namecheap for your apex domain request an A or AAAA record, and Namecheap answers with standard A/AAAA records after resolving your target behind the scenes.

How long does it take for a Namecheap ALIAS record to propagate?

If you replaced an existing A record, propagation depends on that old record’s TTL (usually 30 minutes to an hour). On a brand-new domain with no cached entries, resolution typically starts working worldwide in under 5 minutes.

Next Steps

Once your apex domain resolves, make sure your edge certificates hand off cleanly. If your host uses DNS challenges to provision SSL certificates, check our walkthrough on verifying SSL certificates with Namecheap CNAME records.

all_in_one_marketing_tool