# HOST file questions

**URL:** <https://boards.straightdope.com/t/host-file-questions/545833>\
**Category:** Factual Questions\
**Created:** [July 7, 2010, 10:57am UTC](https://boards.straightdope.com/t/host-file-questions/545833 "2010-07-07T10:57:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rhythmdvl](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@Rhythmdvl](https://boards.straightdope.com/u/Rhythmdvl)\
**Post date:** [July 7, 2010, 10:57am UTC](https://boards.straightdope.com/t/host-file-questions/545833/1 "2010-07-07T10:57:03Z")

</div>

I haven’t monkeyed with the HOST file since moving to Windows 7, so there may have been changes that nullify these questions.

Is there a managed program/service that regularly updates the HOST file with new incarnations and finds? From what I understand, wildcards (e.g., \*.doubleclick.net) don’t work so you need to have multiple entries. As soon as doubleclick adds another subdomain, it’s getting through your HOST file.

If I do have [doubleclick.net](http://doubleclick.net) in the HOST file, will it still show up in the NoScript alert? Or will Firefox recognize that it’s pointing to home and, once I’ve allowed 127.0.0.1 globally, it will no longer show up.

(By the way, is allowing 127.0.0.1 in NoScript a bad idea?)

Lastly (I think), can the HOST file point to a local file instead of an IP address (e.g., c:\somedirectory\I’m in ur HOST.htm)? If not, is there any way to tell differentiate between a Web page that’s unreachable or in the HOST file?

No-really-I’m-not-kidding-lastly, what’s the convention on capitalization?

Thanks,

Rhythm

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [July 7, 2010, 11:12am UTC](https://boards.straightdope.com/t/host-file-questions/545833/2 "2010-07-07T11:12:13Z")

</div>

[QUOTE=Rhythmdvl]  
Is there a managed program/service that regularly updates the HOST file with new incarnations and finds?  
[/quote]  
[Installing and using Privoxy would solve most or all of your problems.](http://www.privoxy.org/) Managing your hosts file by hand is not worth it if you just want ad-blocking.

> [@](#):
>
> If I do have [doubleclick.net](http://doubleclick.net) in the HOST file, will it still show up in the NoScript alert? Or will Firefox recognize that it’s pointing to home and, once I’ve allowed 127.0.0.1 globally, it will no longer show up.

All this stuff is largely invisible to Firefox, and it won’t affect NoScript at all. All Firefox sees is that some domains resolve really fast and don’t serve any content.

> [@](#):
>
> Lastly (I think), can the HOST file point to a local file instead of an IP address (e.g., c:\somedirectory\I’m in ur HOST.htm)?

No. You need a proxy to do things like that. A proxy is a program that sits in-between your browser and the Internet and looks at everything that passes between the two, taking action on specific patterns. Privoxy is a proxy; I don’t think it can do what you want here, but you can chain proxies if you find one that does.

> [@](#):
>
> If not, is there any way to tell differentiate between a Web page that’s unreachable or in the HOST file?

Yes: An unreachable web page either will have a domain name that doesn’t resolve to anything or it will be on a server that returns an HTTP error code. A web page stored on a server blocked by your hosts file will be on a server that resolves to your local machine, which may serve up content of its own (as Privoxy does).

---

<div class="post-metadata">

**Author:** ![Quartz](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/quartz/32/267_2.png) [@Quartz](https://boards.straightdope.com/u/Quartz)\
**Post date:** [July 7, 2010, 11:14am UTC](https://boards.straightdope.com/t/host-file-questions/545833/3 "2010-07-07T11:14:01Z")

</div>

> [@Rhythmdvl](#):
>
> I haven’t monkeyed with the HOST file since moving to Windows 7, so there may have been changes that nullify these questions.
> 
> Is there a managed program/service that regularly updates the HOST file with new incarnations and finds?

Modifying the hosts file is not the optimal tool for this. You want a dynamic filtering application.

> [@](#):
>
> From what I understand, wildcards (e.g., \*.doubleclick.net) don’t work so you need to have multiple entries. As soon as doubleclick adds another subdomain, it’s getting through your HOST file.

Correct.

> [@](#):
>
> Lastly (I think), can the HOST file point to a local file instead of an IP address (e.g., c:\somedirectory\I’m in ur HOST.htm)? If not, is there any way to tell differentiate between a Web page that’s unreachable or in the HOST file?

You may be thinking of the LMHOSTS file which does allow inclusion of other files.

> [@](#):
>
> No-really-I’m-not-kidding-lastly, what’s the convention on capitalization?

Lower case.

Do note [Can't modify the Hosts or Lmhosts file - Windows Server | Microsoft Learn](http://support.microsoft.com/kb/923947)

---

<div class="post-metadata">

**Author:** ![Hodge](https://avatars.discourse-cdn.com/v4/letter/h/5f9b8f/32.png) [@Hodge](https://boards.straightdope.com/u/Hodge)\
**Post date:** [July 7, 2010, 1:44pm UTC](https://boards.straightdope.com/t/host-file-questions/545833/4 "2010-07-07T13:44:30Z")

</div>

I’ve never bothered with proxy filtering or ad-blocker plugins. For years, I’ve just manually updated the HOSTS file from [Blocking Unwanted Connections with a Hosts File](http://mvps.org/winhelp2002/hosts.htm)

It’s updated every 3 or 4 weeks and I’ve found it more than adequate to stop the vast majority of ads and popups.

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [July 7, 2010, 1:55pm UTC](https://boards.straightdope.com/t/host-file-questions/545833/5 "2010-07-07T13:55:22Z")

</div>

> [@Quartz](#):
>
> Lower case.

Huh? From [RFC952](http://tools.ietf.org/html/rfc952): “No distinction is made between upper and lower case.”

---

<div class="post-metadata">

**Author:** ![Rhythmdvl](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@Rhythmdvl](https://boards.straightdope.com/u/Rhythmdvl)\
**Post date:** [July 7, 2010, 2:14pm UTC](https://boards.straightdope.com/t/host-file-questions/545833/6 "2010-07-07T14:14:37Z")

</div>

Thanks!

There’s a lot of information in Privoxy’s FAQ page (not even its manual), so I need to digest a lot there before I have any questions about it.

Since I have AdBlock and NoScript, seeing ads isn’t that much of an issue. But unless I’m missing a preference setting, there is no way to get NoScript to permanently forbid doubleclick (as an example) and stop giving me that red notification icon.

I’ve basically picked up the belief that keeping a host file (or something similar) relatively up to date is simply prudent. In a nice touch, mvps is what I use as the basis. But updating every once in a while seems so … so … antiquated. Hence the genesis of the question about an app that could do it for me in the background.

Oh, about the case: I was asking about its use in writing. I’ve seen it both upper and lower case, and the file itself is all caps. Any story or reason behind that?

---

<div class="post-metadata">

**Author:** ![arseNal](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@arseNal](https://boards.straightdope.com/u/arseNal)\
**Post date:** [July 7, 2010, 2:59pm UTC](https://boards.straightdope.com/t/host-file-questions/545833/7 "2010-07-07T14:59:53Z")

</div>

Adding entries to the host file to “block” unwanted sites while browsing the web has always been a hack. Heck, using the hosts file for _anything_ these days is almost antiquated.

As others have said, use proper content filtering software/browser plugins to achieve this. Doesn’t Adblock allow wildcards to allow you to block anything coming from [doubleclick.com](http://doubleclick.com)? Also, how does NoScript work for you? Do sites like SDMB work properly?

Regarding the case – well for the filename itself, since it (probably) originated on unix-like systems, case mattered and it had to be lowercase AFAIK. However, hostnames were never case sensitive on the internet as we know it, so the contents of the file itself didn’t matter if it was upper or lowercase.

---

<div class="post-metadata">

**Author:** ![Quartz](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/quartz/32/267_2.png) [@Quartz](https://boards.straightdope.com/u/Quartz)\
**Post date:** [July 7, 2010, 3:39pm UTC](https://boards.straightdope.com/t/host-file-questions/545833/8 "2010-07-07T15:39:35Z")

</div>

> [@ftg](#):
>
> Huh? From [RFC952](http://tools.ietf.org/html/rfc952): “No distinction is made between upper and lower case.”

True, but using lower case makes it a lot easier to read. The question was about the convention, not the rule.

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [July 7, 2010, 6:50pm UTC](https://boards.straightdope.com/t/host-file-questions/545833/9 "2010-07-07T18:50:08Z")

</div>

> [@arseNal](#):
>
> Doesn’t Adblock allow wildcards to allow you to block anything coming from [doubleclick.com](http://doubleclick.com)?

Yes. In fact, the pattern-matching in AdBlock is much more complex than simple globbing.

> [@](#):
>
> Also, how does NoScript work for you? Do sites like SDMB work properly?

You can selectively unblock scripts with NoScript. You can even set NoScript to allow all scripts and use it for its other security features (XSS blocking, Clickjacking blocking, etc.).
