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 have a server and I'm using it as web server, I have a web site hosted in it
In a web browser when I access it using the IP address the site loads very slow, but when I access it using Domain Name (mysite.com) it loads normally
Why the site loads normally while using domain name and very slow while using IP address?

Note: I'm using windows server 2008 R2, IIS7

share|improve this question
    
same problem. Any solutions? –  FlavorScape May 2 '12 at 21:00
add comment

1 Answer 1

The Host HTTP header is different so you should check what is the default virtual host on your server and try to figure it out why it slow. Also without precise measures what takes long you won't be able to even just ask the right question. Try to figure out precisely what is slow with some tool like this.

http://developer.yahoo.com/yslow/ http://www.websitepulse.com/ http://www.pingdom.com/services/

share|improve this answer
    
I mean slow it takes 2-3 minutes to load the homepage, I checked with pingdom and it showed the site loads in one second, it seems in my region the site loads slow with IP address, you said the host HTTP header differs and I should check more with virtual host, sorry but I didn't understand what you meant can you please give me more explanation or a link to clarify it to me (I checked google but no luck) –  Kronass Dec 26 '10 at 10:04
    
Sure, no problem. So when you hit a website with you browser it sends some data to the server called HTTP request header. You can check this URL: en.wikipedia.org/wiki/List_of_HTTP_header_fields So one of these is the "Host" field which tells to the webserver which virtual host to serve. Imagine you have www.yourdomain.com and www.alsoyours.com on your server and both points to the same IP. So the web server must know which one to serve and the decision is based on that field. Hope it helps. –  Istvan Dec 26 '10 at 13:02
    
I'll see about it, thank you for you help –  Kronass Dec 28 '10 at 7:38
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.