Adblock
Hosts File#
Use one of these hosts
files instead of using an adblock plugin since it's faster and covers all applications (not just a single web browser).
Installation#
- Download the respective
hosts
file you wish to use. - Change into the directory you have downloaded the file to and open a terminal in that directory.
-
Execute the command
sudo mv hosts /etc/hosts
to overwrite your current hosts file.Note
Unless you have manually edited the file in the past you do not have to worry about overwriting it. The new downloaded
hosts
file contains all but one default entries. If you have any custom entries, make sure to create a backup of your currenthosts
file and to add the past entries to the new one. -
Check your current hostname by executing the command
hostname
. -
Execute the command
sudo vim /etc/hosts
and add the line127.0.0.1 HOSTNAME
to where all the other127.0.0.1
entries are. The placeholderHOSTNAME
being the result of your command execution in step 4. If you do not do this some applications might not work as intented and the password check ofsudo
will be quite slow.Example
The result of my
hostname
execution iselsenm-desktop
, so I will add the following line to my/etc/hosts
file:1 2 3 4 5 6 7 8 9 10
... 127.0.0.1 localhost 127.0.0.1 localhost.localdomain 127.0.0.1 local 127.0.0.1 elsenm-desktop 255.255.255.255 broadcasthost ::1 localhost ::1 ip6-localhost ::1 ip6-loopback ...