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 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,

share|improve this question
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

4 Answers 4

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.

share|improve this answer

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

share|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. –  ThatGraemeGuy Oct 8 '09 at 20:59

You probably just need to clear your local DNS cache.

If you are on Windows, then run:

ipconfig /flushdns
share|improve this answer

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.

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.