1

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,

1
  • 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, 2009 at 1:36

4 Answers 4

3

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.

1

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

3
0

You probably just need to clear your local DNS cache.

If you are on Windows, then run:

ipconfig /flushdns
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .