Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
    
I'm not so sure, if my www.mydomain.com cname points to my hosting at NearlyFreeSpeech, then the A name record is never considered right? And since mydomain.com is forwarded (301) to www.mydomain.com which is sent to my hosting, the A name record should never even be used. –  mbillard Jan 28 '10 at 1:58
1  
Correct, assuming that the A record for the NearlyFreeSpeech server is on another DNS server (probably theirs), then yes you are right the A record at GoDaddy wouldn't be needed because the 301 would forward it. –  Scott McClenning Jan 28 '10 at 2:36
    
I think the answer is right, but I'm intrigued at how google's links work (i.e. why do mydomain.com links didn't work in Google's search results while mydomain.com worked when typed directly in the adress bar. –  mbillard Jan 31 '10 at 19:53
    
Now that you said that, it reminded me of a problem I heard about once. Servers were getting hacked and if the person arriving at your site came from somewhere (like Google) they were redirected to another site. However, if they used a bookmark they actually arrived at the site. In that case, the server's .htaccess file was configured to do this redirection. (techspot.com/vb/topic108867.html) Hopefully this will either be easy to fix or to ask the host to fix. –  Scott McClenning Feb 1 '10 at 5:08

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.