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).
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.
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
Now, you should see Facebook widgets disappear like by magic on every page you visit !