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

If I have the following records in the DNS:

hostname               Record Type         address       A            CNAME     

What should the user expect to see in a browser's address bar when they type in how about I was expecting that I would see change to in the address bar, but perhaps I misunderstand how a CNAME record is supposed to work.

(Note: I just updated the dns for my site about 15 minutes ago, so perhaps the changes haven't propagated yet.)

share|improve this question
up vote 5 down vote accepted

They should see whatever address they type in, unless you've set up some sort of redirect on the webserver.

Also, it looks like either you didn't update your zone file correctly or it hasn't propogated yet, as the is coming back as an A record:

$ dig

; <<>> DiG 9.6.0-APPLE-P2 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 809
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;  	IN	A

share|improve this answer

You've setup the DNS correctly. The "www" part of the URL should not be mandatory so both "" and "" should resolve to the same web server. That is the way it is intended to be.

If you want to redirect all requests to the non-www form, add this to Apache conf. file

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
share|improve this answer

A CNAME is a DNS thing, a URL is a browser thing. Other than using DNS to look up the name in the URL hostname field, the two don't really affect one another.

If you want to do this, here's what I do on Apache 2 configs to redirect from one to the other:

<VirtualHost *:80>
  RedirectMatch permanent /(.*)$1
share|improve this answer
that makes sense. I'm working with a hosted site's DNS (on IIS, I think. The main site is IIS). – Ben McCormack Dec 3 '09 at 3:19

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.