Webmasters Stack Exchange is a question and answer site for pro webmasters. 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

I was just hoping someone could point me in the right direction. I want to have my website hosted which I want to display as www.mydomain.com I also need mydomain.com and blog.mydomain.com to go to the same IP.

Do I need to create:

  1. 1 x AName record for www.mydomain.com which points at my server static URL

  2. Then create 2 x CName records which both point at www.mydomain.com


Because if thats the way it's done then I want to set a redirect up on my IIS server to 301 to www.mydomain.com if it sees the URL as mydomain.com.

Does this sound okay?

share|improve this question

migrated from superuser.com Sep 16 '13 at 18:17

This question came from our site for computer enthusiasts and power users.

up vote 3 down vote accepted
  1. You should set three A records poiting to your server IP.
    • *.mydomains.com
    • www.mydomain.com
    • blog.mydomain.com
  2. Then you need to set up your Virtual Host correctly to accept requests for all three domains/subdomains (see e.g. Virtual hosting with IIS (Internet Information Services) or Setting Host Headers in IIS 6.0).
  3. Redirect needed domains to one desired domain using URL Rewrite module and 301 redirect (e.g. both www and blog to mydomain.com) so you don't have "duplicate" content.
share|improve this answer
What is wrong with using CNAME? – Paul Sep 16 '13 at 20:32
I wouldn't say wrong, BUT: 1) two DNS queries instead of have to be done, 2) it might get a bit confusing e.g. with MX records (might not work as expected :-)), 3) and most important: Canonical Name is an alias, so if you type alias into the browser (e.g. with WWW) it won't change to non-WWW version, which might not be the best behavior (e.g. for SEO reasons). – David Lukac Sep 16 '13 at 20:56

Yes. You may find the Wikipedia article on CNAME informative.

share|improve this answer
"Yes" and a link is not an answer - it's a comment. Please view the FAQ's for this site on Answers. – dan Sep 17 '13 at 6:40
Link only answers are not appropriate. Links break, information on other sites goes away. Please either explain in your own words what the other site says or use a blockquote from the other site. – Stephen Ostermiller Sep 17 '13 at 9:51

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.