In GoDaddy, I added a CNAME record for www.example.com to point to example.nfshost.com. So far so good.
Grand. By the way, a CNAME record is not merely an alias for an A record. It’s an alias for everything. AAAA records, MX records, TXT records, whatever.
I also set example.com (no www) to forward to www.example.com (still in GoDaddy).
Ah, how? You see, there’s really no way to forward domains, per se, in DNS. There’s the CNAME record, which means this is the same as that. But what I think you want here is a redirect, and that’s done with HTTP. That means that your example.com
must have an A record (and/or an AAAA record) pointing to a web server, and that web server must output a HTTP 301 or 302 response redirecting the browser to www.example.com
.
Where is that web server? Well, perhaps GoDaddy handles it for you, with a “redirect” record type, but that’s what’s happening under the hood.
Could you have a CNAME record for the bare domain, so that example.com
has the CNAME example.nfshost.com
or whatever? No, you can’t.
- CNAME records are not merely aliases for A records; they’re aliases for everything. Any domain with a CNAME record may not have any other kind of record.
- A domain must have NS records.
The conflict between these two rules means that CNAME records can exist only for subdomains.