Super User is a question and answer site for computer enthusiasts and power users. 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

The article recommends editing the Windows HOSTS file in c:\windows\system32\drivers\etc as a way to block certain websites.

I noticed some interesting behavior when adding the line:

In Firefox 7.0, when I attempt to navigate to '', I get a Server Not Found error, as expected. However, when I attempt to navigate to '', the page is retrieved without error.

Why the different behavior? Why does it resolve the URL differently when the www is prepended to the domain name?

Update: With the line edited to '', both above requests are blocked. I'd still like to understand the reason for the different resolution. I see, using PING, that the URLs in question do resolve to different IPs.

share|improve this question
If you had said IE, I have seen before that Google would "resolve" and connect , before I had my connection working properly in W7. We had seen this behaviour years before where MSN would work with my poor setup net , until i got dns and full connect working. I had always believed that somewhere in the OS , there were IP Numbers that resolved MSN just so a dns type problem would not exist for them. (and this time google) even though no DNS had come though YET for that computer (could be leftover junk from MSes DVD Image they sell me). Mabey Clear the DNS before testing ? – Psycogeek Sep 30 '11 at 6:22
Note that this is a very poor way to achieve the desired goal. It mucks up everything else's name→address lookups, isn't scalable and maintainable for the large numbers of hostnames that one inevitably ends up with, and has too coarse a granularity in many cases. The far better ways to achieve this same end are (a) a Proxy Auto-Configuration file, or (b) a rewriting proxy HTTP server. – JdeBP Oct 6 '11 at 13:27
Thanks JdeBP. Can you give a little more detail on how it can "muck up everything else's lookups"? – slachterman Oct 7 '11 at 18:21
I have. – JdeBP Nov 26 '11 at 19:37
Thanks, that was informative. – slachterman Nov 27 '11 at 8:44
up vote 3 down vote accepted

The www portion of an URL has some history behind it. Extracted from Wikipedia,

Many domain names used for the World Wide Web begin with www because of the long-standing practice of naming Internet hosts (servers) according to the services they provide. The hostname for a web server is often www, in the same way that it may be ftp for an FTP server, and news or nntp for a USENET news server. These host names appear as Domain Name System (DNS) subdomain names, as in The use of 'www' as a subdomain name is not required by any technical or policy standard; indeed, the first ever web server was called,[27] and many web sites exist without it. Many established websites still use 'www', or they invent other subdomain names such as 'www2', 'secure', etc. Many such web servers are set up such that both the domain root (e.g., and the www subdomain (e.g., refer to the same site; others require one form or the other, or they may map to different web sites.

That being said, the inclusion of the www subdomain is customary most of the time, and and are two entirely different URLs, even if they point to the same IP address after a DNS resolution.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .