up vote 1 down vote favorite
share [g+] share [fb]

I am trying to setup my DNS records to do the following:

When user hits www.example.com they are directed to server with ip 1.1.1.1
When user hits example.com they are directed to server with ip 2.2.2.2

I have full control over server 1.1.1.1, where I set up the DNS:

A record for example.com. to 2.2.2.2
A record for www to 1.1.1.1

I'am not sure if the DNS got refreshed but when I hit www.example.com I am hitting the 2.2.2.2 and it displays a incorrect page as it is not set up to handle the www.example.com, but example.com only.

Thanks in advance,

link|improve this question

40% accept rate
1  
Suggest you specify what DNS you are running, tell us if it is an internal issue or for the whole internet, and post the config file if you can. – tomjedrz Oct 9 '09 at 1:36
feedback

4 Answers

up vote 3 down vote accepted

It sounds like the DNS change has not yet propagated. This can take up to a day, or even more, depending on your DNS settings.

You can try the tools at dnsstuff.com to see what your different hostnames are resolving to, and if everything looks good there, then just wait a day or two for the changes to propagate.

link|improve this answer
feedback

You can also test your dns entries on Linux and Mac OS X by using the "dig" command

dig @YOUR_NAMESERVER_ADDRESS foo.com

dig @YOUR_NAMESERVER_ADDRESS www.foo.com

link|improve this answer
If he were on Linux, but we don't know that. – DanBig Oct 8 '09 at 20:34
Edited my entry and added the OS info – jomey Oct 8 '09 at 20:37
dig is available for Windows too. members.shaw.ca/nicholas.fong/dig. – Graeme Donaldson Oct 8 '09 at 20:59
feedback

You probably just need to clear your local DNS cache.

If you are on Windows, then run:

ipconfig /flushdns
link|improve this answer
feedback

To more directly answer your question, the zone file for example.com would have

@ A 2.2.2.2

www A 1.1.1.1

The @ stands in for the "root" of the zone (example.com in this case). All you ever specify is what comes before the "root", e.g., www for www.example.com.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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