Welcome Guest! To access all forums & features, please register an account or sign-in. → Why register?



CNAME www.example.com to example.com?


4 replies to this topic - - - - -

#1 primexx

    Neowinian ULTRAKILL

  • 12,028 posts
  • Joined: 24-April 05

Posted 10 February 2013 - 11:11

I currently have A records on both www.example.com and example.com pointing to the same IP. I just came across a site that CNAMEd the www. address to example.com and only had the A record in example.com itself. It seems like a pretty good idea, I can't think of anything that says you're not supposed to do that, but I just want to double check with you guys to make sure I'm not missing something obvious here. Can you CNAME the www. to the root domain (or is it a good idea)? Thanks!


#2 Freelancer1111

    Neowinian²

  • 206 posts
  • Joined: 11-December 10
  • Location: Germany

Posted 10 February 2013 - 11:53

Can't you just do an A Record like this :

* 86400 IN A xxx.xxx.xxx.xxx

to get everything pointing to your IP-Adress ?



I did some further research and it looks like the thing you want to achieve is impossible,
http://serverfault.c...-to-be-a-cname/
This one may explain this a little more.

You could workaround this with a 302-redirect, making www.example.com redirect to example.com

#3 Graimer

    Neowinian²

  • 120 posts
  • Joined: 08-October 04
  • Location: Norway

Posted 10 February 2013 - 12:09

Yes, you can use a "www." CNAME record pointing to "example.com" and then have "example.com. IN A my.servers.ip.address". CNAME is just a alias, and can point to any A record in your zone. Ex. you can create CNAME records for "www.", "owa.", "smtp." that all point to the same A record("example.com") if you have all services that host.

#4 ajcdotme

    Neowinian

  • 61 posts
  • Joined: 17-November 11
  • Location: Ligonier, PA
  • OS: Mint 14 Debian Edition

Posted 10 February 2013 - 18:16

This is pretty common practice, primexx.

@ IN A IPADDRESS
WWW IN CNAME @

#5 OP primexx

    Neowinian ULTRAKILL

  • 12,028 posts
  • Joined: 24-April 05

Posted 10 February 2013 - 21:19

thanks guys I was a little surprised that I missed something so obvious so I thought I'd double check that it is, in fact, okay to do it that way :p