Social networks are omnipresent on the Internet. Most websites include social widgets, allowing to “like” or “bookmark” pages. However, these widget can help track your browser’s IP, user agent, history, gelocation etc. This happens even if you are not connected and don’t own an account on the social network.
To avoid this, we can edit the hosts file, which contains IP address / hostname associations.
On Windows, it is located at C:\Windows\System32\drivers\etc\hosts, on Linux it is at /etc/hosts and on Mac it is there: /private/etc/hosts.
Then, it is sufficient to add this line at the end of the file and save (you need administrator privileges to save).
1 |
127.0.0.1 facebook.com instagram.com |
Adapt the domain name list with any domain you would like to block.
Here is an example hosts file blocking facebook.com.
1 2 3 4 5 6 7 8 9 10 |
127.0.0.1 localhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 127.0.0.1 facebook.com |
Now, you should see Facebook widgets disappear like by magic on every page you visit !