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).
- 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.
- Check your current hostname by executing the command hostname.
- Execute the command sudo vim /etc/hosts and add the line 127.0.0.1 HOSTNAME to where all the other 127.0.0.1 entries are. The placeholder HOSTNAME 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 of sudo will be quite slow.