Hosts: Readme uses 127.0.0.1 as example but refers to 0.0.0.0 as the better method

Created on 12 Feb 2016  路  3Comments  路  Source: StevenBlack/hosts

The title speaks for itself.
I'm unable to create a push request for this right now. Which is why I'm making a ticket for it.

Extract from README:


For example, to nullify requests to some doubleclick.net servers, adding these lines to your hosts
file will do it:

# block doubleClick's servers
127.0.0.1 ad.ae.doubleclick.net
127.0.0.1 ad.ar.doubleclick.net
127.0.0.1 ad.at.doubleclick.net
127.0.0.1 ad.au.doubleclick.net
127.0.0.1 ad.be.doubleclick.net
# etc...

Why use 0.0.0.0 instead of 127.0.0.1?

Using 0.0.0.0 is faster because you don't have to wait for a timeout. It also does not interfere
with a web server that may be running on the local PC.


EDIT: I just noticed there's a pull request for this: #66

Documentation

Most helpful comment

Hi @TheGroundZero thanks for posting this issue.

This is intentional.

One of the hurdles for this repo is to educate folks about hosts files. In almost all cases, 127.0.0.1 is used elsewhere in hosts files, documentation, and related tutorials. I don't want to muddle that.

We use 0.0.0.0 here as an incremental refinement on 127.0.0.1 since, on some OS, 0.0.0.0 resolves quicker because it doesn't time out.

Presenting 0.0.0.0 as an incremental refinement seems to be working so far.

But I'm open to be convinced otherwise :-)

All 3 comments

Hi @TheGroundZero thanks for posting this issue.

This is intentional.

One of the hurdles for this repo is to educate folks about hosts files. In almost all cases, 127.0.0.1 is used elsewhere in hosts files, documentation, and related tutorials. I don't want to muddle that.

We use 0.0.0.0 here as an incremental refinement on 127.0.0.1 since, on some OS, 0.0.0.0 resolves quicker because it doesn't time out.

Presenting 0.0.0.0 as an incremental refinement seems to be working so far.

But I'm open to be convinced otherwise :-)

Perhaps change the bold line to "We recommend using 0.0.0.0 instead of 127.0.0.1"
That makes it clear that it is an intentional difference, instead of what looks like a mistake in the example.

I confirm it looks as documentation bug. All examples are written with 127.0.0.1 and then there's a bold title _Why use 0.0.0.0 instead of 127.0.0.1_, this hardly makes sense to reader.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

onmyouji picture onmyouji  路  3Comments

beerisgood picture beerisgood  路  3Comments

scafroglia93 picture scafroglia93  路  3Comments

CyanoTex picture CyanoTex  路  3Comments

Sego1234 picture Sego1234  路  3Comments