Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am currently setting up a domain name on windows server 2008r2 iis7

In the local hosts file I have mapped Domain.com and www.Domain.com to the localhost

The iis7 website has the bindings for Domain.com and www.Domain.com

However, from the internet the website only loads up when browsing to www.Domain.com

Is there something I am missing to make it work on Domain.com

share|improve this question
    
Is your DNS correctly setup so domain.com points to your server –  Sam Jan 10 '10 at 0:06
    
Would that just be setting up a forward dns for the A record with the record name as "" for .Domain.com to the IP Address for the server? –  asn187 Jan 10 '10 at 0:19
    
As Sam has said, make sure you set up a DNS A record for the domain that points to the public ip address that you're forwarding to the server. –  joeqwerty Jan 10 '10 at 0:19
    
yes, you should just need an A record for domain.com pointing to the IP of the server. –  Sam Jan 10 '10 at 1:09
    
Perfect thanks for confirming. –  asn187 Jan 10 '10 at 1:15
add comment

1 Answer

As Sam pointed out the host file only handles resolution for the local computer. For everyone else, you need to have a DNS record.

To have both domain.com and www.domain.com active, you'll actually need to create two records. The first would be an A record for domain.com that points to the IP address of the web site. The second would be a CNAME record in that domain for www that points to the name domain.com. That way anyone accessing www.domain.com would automatically be sent to domain.com.

share|improve this answer
    
You could simply use an A record for both domain.com amd www.domain.com instead of using a CNAME. IMHO it's 6 of one and half a dozen of the other, although the use of a CNAME will require an additional lookup for www.domain.com. –  joeqwerty Jan 10 '10 at 1:34
    
True, but if you change IPs later on you will have to update both of them. I personally tend towards making things simpler to administrate, on the theory that I will always forget something. –  Graham Powell Jan 10 '10 at 2:02
    
True enough... :) –  joeqwerty Jan 10 '10 at 2:08
add comment

Your Answer

 
discard

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.