Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Currently, I simply have

www 10800 IN A

and with this, works, but not

share|improve this question
Could we see the rest of the zone file? It's difficult to say how exactly to do this without seeing the structure of the zonefile. –  MadHatter Feb 13 '11 at 20:48

3 Answers 3

Your DNS servers sees and as 2 completely separate Domains. Due to this you also need to add an A record for just also like IN A xxx.xx.x.x

Where xx.x.x.x is the same IP as www.

share|improve this answer
Hey! Thanks for the quick response. Is this as same as adding a CNAME? If not, what's the difference? –  randomguy Feb 13 '11 at 20:54
No, a cname would be for setting to forward to You don't have An A record for only so thats why only 1 works. you need to add a A record for like IN A (IPhere). It should look like except there should be no www. on it. –  Jacob Feb 13 '11 at 21:01
Small clarification: You'll need a dot after, as " IN A xxx.xx.x.x" Otherwise you are creating a record for "" –  Cakemox Feb 13 '11 at 22:04
Forgot to add that thanks. –  Jacob Feb 13 '11 at 22:13

Generally you should make your www address a CNAME for your real server name in dns:


then when you do a dns lookup of, and the result should be the same IP address in all cases.

Then (assuming you use apache) in the main section of your httpd.conf you should have:

UseCanonicalName off

so that requesting hosts can indicate the name they are trying to connect to and the server will always respond properly.

share|improve this answer
Hm Jacob you are right, my answer may be a bit outdated. Looking at the googles it seems like cnames are less efficient. –  Phil Hollenback Feb 13 '11 at 21:04
Jacob, please expand about why vhosts won't work. I took that config from a server that is running name-based vhosts. –  Phil Hollenback Feb 13 '11 at 22:13
Jacob, that doesn't make any sense whatsoever. The server hosting the websites sees an HTTP Host: header provided by the client. It doesn't care how the client found the IP address it's connecting to -- that's totally irrelevant information. –  jgoldschrafe Feb 13 '11 at 22:55
Sorry I typed the wrong thing, Vhosts will work but Cnames cause 2 lookups to be made to the server so thats why A records are better –  Jacob Feb 13 '11 at 23:00

I typically do the following: A [IP] and then www CNAME

(so that you don't repeat the IP twice)

share|improve this answer
Cname causes 2 lookups at the server.not very efficant –  Jacob Feb 13 '11 at 22:57
I suppose so, in that case having two A records would work also. But it is a DNS server, using CNAMES I would assume is only marginally less efficient. –  farinspace Feb 14 '11 at 16:46

Your Answer


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.