Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a bit of a unique problem. for the domain (example.com) I want people to go to www.example.com however I'm also throwing GSLB into the mix. for GSLB the devices(one in each datacenter) need to be the nameserver for portion of the domain that they are going to answer for(www.example.com) so I know I can make the NS record of www.example.com just fine and have it point to each GSLB device. However that only helps for www.example.com NOT example.com. I don't want to make my root NS of example.com my GSLB as my enterprise managed DNS provider does an excellent job of all DNS stuff. any ideas?

share|improve this question
add comment

4 Answers

up vote 1 down vote accepted

You'll need to setup a web server at example.com and do redirects. I would suggest that the redirects are 301 (permanent) and not 302 (temporary) as you want any links to example.com to count as links to www.example.com from an seo point of view. There are services out there that can handle the redirects for you, or you can roll your own.

A cname based solution is suboptimal because 1) technically you can't have cnames when you have other records and 2) you'd be surfacing identical content at to different addresses and search engines don't like that.

share|improve this answer
add comment

A common approach to overcome this limitation in DNS is to provide a HTTP 302 redirect from example.com to www.example.com.

Here are the restrictions based on the RFCs:

  • CNAMEs must have no other resource records of other types (MX, A etc) as specified by RFC 1034 section 3.6.2 and RFC 1912 section 2.4. The exception is when DNSSEC is being used, in which case there can be a DNSSEC related recrd such as RRSIG, NSEC, etc. (RFC 2181 section 10.1)

  • CNAME records that point to other CNAME records should be avoided. In particular, it is possible to create infinite loops with CNAME records, and other error conditions. RFC 1034 section 5.2.2.

  • Other DNS record types, such as NS, MX, PTR, SRV, etc that point to other names should never point to a CNAME. RFC 1034 section 3.6.2, RFC 1912a, section 2.1.

share|improve this answer
add comment

Use redirection of a web server and in dns define CNAME www to example.com.

share|improve this answer
add comment

A CNAME record should be able to redirect requests for example.com to www.example.com.

share|improve this answer
    
My DNS provider won't let me create an empty CNAME. –  ChrisMuench Feb 22 '11 at 18:44
2  
DNS cannot do re-directs –  Zypher Feb 22 '11 at 19:33
add comment

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.