1

I have recently learnt about 2 different ways of editing the hosts file in Ubuntu for the purpose of blocking webpages and domains tracking my computer (protecting myself from tracking cookies), and I am a little confused here because there are guys who recommend editing the "hosts" file usually located in ~\etc\hosts by using 127.0.0.1 before adding a page address to be blocked and there are guys who recommend using 0.0.0.0 before adding a page address to be blocked.

I have tested both ways in Windows XP and Windows Server 2003 only, and all I can tell so far is that using a template in this form:

127.0.0.1 google-analytics.com
127.0.0.1 ssl.google-analytics.com

is not good at all for my system, and it can slow down even the most common operations.

But I have found that using a template in this form:

0.0.0.0 google-analytics.com
0.0.0.0 ssl.google-analytics.com

seems to be ok as far as system stability is concerned, and even the webpages are loading faster.

My question is whether this method (editing the hosts file) will truly work for blocking webpages and domains tracking my computer in Linux/Ubuntu. I know little about network security so I can't test properly if I am actually more protected now than before after editing this hosts file the way I seen it's meant to be done in the tutorials from the Internet.

So, to conclude, I have these questions:

  1. Which one is better to use before adding the page address to be blocked in 'hosts' file configuration, is it 127.0.0.1 or 0.0.0.0?

  2. How to test if my network security is better after editing the hosts file?

Eric Carvalho
  • 55,453
Taz D.
  • 2,255

1 Answers1

4

You should use 127.0.0.1, the so-called loopback address. Unlike 0.0.0.0, it is a valid IPv4 address.

While it is true that this mitigates some tracking issues, this does not improve security per se.

There are a gazillion sites that track you, and you can't keep up editing your hosts file. To prevent tracking, you'd better use plugins like AdblockPlus and NoScript that auto-update the list of sites to block.

Also note that security is a process, not some setting or configuration.

To strengthen your security, you also need to consider

  • setting up a firewall
  • physical access to your machine
  • lots of other things that would be out-of scope here.
Jan
  • 12,931
  • 3
  • 34
  • 39