1

I'm using GoDaddy for my domains and NearlyFreeSpeech for my hosting. I want to keep using GoDaddy for my DNS needs as it comes free with the domains.

In GoDaddy, I added a CNAME record for www.mydomain.com to point to mydomain.nfshost.com. So far so good. I also set mydomain.com (no www) to forward to www.mydomain.com (still in GoDaddy).

My question is: is the A name record relevant or can I just delete it?


The reason I'm asking this is because I used to use the no-www domain for my websites, but I've decided to switch recently (I've seen the light). However, when my site shows up in Google's search results, it still says http://mydomain.com and it can't find the server.

I'm guessing this is Google's fault and that maybe this will get resolved once Google's bots refresh their index because manually typing http://mydomain.com correctly redirects to www.mydomain.com.

Thanks

mbillard
  • 135

2 Answers2

2

The A record is what translates the name to IP address. e.g. mydomain.com = 1.2.3.4
The CNAME is an alias for an A record. e.g. www.mydomain.com = mydomain.com
So without the A record the CNAME wouldn't go anywhere.

Wikipedia source

As far as Google going to the right place and not thinking there are two sites mydomain.com and www.mydomain.com, I've heard people use a 301 Moved Permanently or 301 Redirect. This tells Google you have moved and all the old records and ranking for the old page now should be associated with the new page. I'm not sure but I believe GoDaddy will allow you to set/customize those codes.

1

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.

  1. 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.
  2. A domain must have NS records.

The conflict between these two rules means that CNAME records can exist only for subdomains.

TRiG
  • 1,360