Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The website I built my girlfriend is not resolving on her Mac when she types www in before the domain name. Is it her browser or do I need to set up a www redirect somewhere?

share|improve this question
Does it work on your machine? If yes, what browser is she using? This has nothing to do with the mac. – rpflo Jun 25 '09 at 4:32
I know this is a nitpick, but were reserved especially for examples, use them! :P – R. Pate Jun 25 '09 at 4:34
where you registered the domain? (in order to give you suggestion on how to configure the DNS as easy as possible) – Magnetic_dud Jun 25 '09 at 7:11
I registered at and host through The only dns setup I can do at namecheap is to point is at servage name servers. – Bryan Jun 25 '09 at 18:04
up vote 17 down vote accepted

I usually set the DNS records like this:

@  IN A
www  IN A

You could, of course, use a CNAME for the www but I prefer to use A records if not necessary. Also you may (or may not) prefer to use an Alias instead of a redirect.

You set it up in Apache like this:

share|improve this answer
Precise and correct. – pauska Jun 25 '09 at 8:16
Quite right! Additionally, I always add that ServerName/ServerAlias, respectively with and without the www. precisely for this reason. Many sites nowadays (look at your location bar right now) are opting to drop the www. – msanford Jul 15 '09 at 0:01
I mean, respectively without and with. – msanford Jul 15 '09 at 0:02

On your DNS management area for your domain you need to add a CNAME record, this basically means the www record will point towards the IP for  		300  	IN A  	300 	IN CNAME

Most DNS control panels should give you this ability.

share|improve this answer

If you only have an A record for, people who query will not get a valid response that points them to your server. Same goes for the other way around.

I have seen people set their as an A record and then have a CNAME for pointing to But as using CNAMEs is not encouraged (so I hear, I am not a DNS guy), having two A records for both and pointing to the same IP is fine too, I guess.

In short, yes, you need to setup a DNS record for as well as for A redirect will not work, since it is not possible to successfully resolve both hostnames in DNS.

share|improve this answer
This is because of the Google 'juice' is then split. You want to pick one or the other but not both. The one that is not picked should issue a 302 redirect to the correct name. – Jauder Ho Jun 25 '09 at 8:01
@Jauder Ho - You should issue a 301 redirect, not a 302 – John Rasch Nov 19 '09 at 21:03

Just add an '@' A record and point it to your server's IP address.

share|improve this answer
Adding A record does'nt solve, They are already getting which is A record , They are asking why is not resolving. For that they have to add an CNAME record that may solve the problem. as Swanny says. – Caterpillar Jun 25 '09 at 10:04

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.