Block Ads with Ubuntu without installing anything

okay in one of my nights searching the internet and ubuntu forums i came a cross a nice tweak for Ubuntu. It involves messing with your etc/hosts file in order to block web sites that produce ads. Cool eh? Here is how:

1. back up your original host file located at etc/hosts
sudo cp /etc/hosts /etc/hosts.old

2. Download a good/updated host file here

3. Open your hosts file
sudo gedit /etc/hosts

4. Paste the contents of the downloaded hosts file (from mvps) into the bottom of the /etc/hosts - do not override any content!

5. Test it out, try loading one of the sites in your browser. You should get a 404 error message.

To take this even further you can use a hosts file update script located here

Follow these steps
1. Download the file at

2. Rename to

3. Make the file executable by doing using the follow command
chmod a+x

4. Install tofrodos
sudo apt-get install tofrodos

5. Run the update
sudo ./
This tweak has been tested and seems to work 100% on Ubuntu FF - no guarantees

Clicky Web Analytics