I’m looking at a web site we’ll call http://www.example.com . A quick traceroute www.example.com shows that its IP address is 208.76.xx.xxx .
When I browse to “www.example.com” in Firefox, I am shown the web site (a login page). However, when I browse to 208.76.xx.xxx , I am shown a default “Welcome to cPanel!” web page.
Here is some more information:
- When I navigate to “www.example.com” or “http://www.example.com” in Firefox I am redirected to “http://example.com” where I see the normal web page.
curl -L www.example.comreturns the web site, whilecurl -L 208.76.xx.xxxreturns the “Welcome to cPanel!” page.- Looking at just the headers:
curl -LI www.example.comshows that I am redirected to the site’s login page (as expected), whilecurl -LI 208.76.xx.xxxdoes not have a redirect. - 208.76.xx.xxx does not appear in my hosts file.
- I am using OpenDNS.
Can someone please explain why navigating to the site’s domain name shows a completely different page than navigating to the site’s IP address?
Thanks for your help, and feel free to ask questions/suggest tests for me to run.
It is called virtual hosting.
One web server (and IP address) can server thousands of sites, with different Host: field in HTTP requests.
You ask browser for example.org; browser tells the server
Webserver looks if it can serve example.org, if it can, it would serve the root page for this specific site.
Proxies also work that way: you browser sends every HTTP request to the proxy, giving Host:, proxy connects to that host, asks for a page and gives it back, cached.