2

I have an A record for my domain for example.com that points to my server's IP address. I would like to modify my DNS records so that www.example.com points to another server.

Is this possible, and would I do that by simply creation a new A type record? Wouldn't example.com override my www.example.com record?

2
  • From your comments on the answers, it sounds to me like what you really want to do is to run virtual hosts on the same server. Its not necessary to run separate servers. Your A records (or CNAME records) might end up both pointing to the same machine.
    – Octopus
    Commented Jun 27, 2013 at 18:07
  • 1
    Out of interest why would you want to do this from a Users point of view this would be really confusing ?
    – sam
    Commented Jun 4, 2014 at 11:53

2 Answers 2

5

Technically, www is a subdomain of example.com. As with any subdomain, you can create a CNAME record to point it to another host. See this for more on CNAME's and an example of pointing www to another host: DNS Made Easy: Example 3

I'd strongly recommend against doing this however if it will take them to another site because it will really confuse visitors since most sites redirect www.example.com to example.com or vice versa, and they might type either into a browser's address bar.

Neither one overrides the other, unless setup in your server to do so through a redirect (i.e., a 301 redirect).

2
  • Thanks for the recommendation, my client actually needs to have it set up that way because one site will be used only for mobile devices (the actual app) and the other for non-mobile devices (the corporate website).
    – gmoz22
    Commented Jun 27, 2013 at 17:42
  • 3
    No problem. I think the standard for mobile content is m.example.com, which is a CNAME record as well.
    – dan
    Commented Jun 27, 2013 at 17:52
2

The proper way to do this is you would make an A record named @ that points to the IP where example.com sits and an A record named www that points to the IP where www.example.com sits.

Some DNS services (such as Amazon's route53) use a blank A record, rather than naming it @.

1
  • Thank you very much for the technical details, I wanted to make sure that this was the proper way to execute what I was trying to do.
    – gmoz22
    Commented Jun 27, 2013 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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