[Solved] Adding block list to hosts file

Ubuntu 21.04. Linux newbie here. For a few months I’ve been thinking about setting up a pi-hole to block ads. But a few days ago I read about just adding a block list to the hosts file. I wasn’t aware of this option. It sounds a lot easier than setting up a pi-hole.

I found some ad block lists here Blocking Unwanted Connections with a Hosts File and here https://github.com/StevenBlack/hosts/blob/master/hosts. Other quality lists I should know about?

When the block list is added to the hosts file, is that about the same as having a pi-hole? What is the advantage of a pi-hole over a block list in the hosts file?

Looks like adding the list to the hosts file is pretty easy. But I’m a newbie, so there may be some important things I don’t know. What do I need to know/do before adding a block list to my hosts file?

Yes, I’ll make a copy of my original hosts file before editing.

If you are working with a single computer, the results may be similar. However, pi-hole is a DNS server that combines many other features, internal DNS, obvisously, and DHCP. Keep in mind that pi-hole is network-wide (if configured appropriately) so it will block ads for all devices on your network, not just a single computer.

For me, pi-hole blocks ads for all computers, mobile phones, streaming TV devices, and tablets.

3 Likes

It also depends on what you want to achieve. If you only use one computer or laptop you can also just go with a regular ad blocker like uBlock from the browser.

Otherwise I would go with the Pi-hole.

2 Likes

I’m working on a single pc. No network. I did some more research and added the https://someonewhocares.org/hosts/zero/hosts block list to my hosts file, rebooted my pc and it seems to be working great. Wow! The internet is a lot different without all the ads.
In the future I may try the “pi-hole in a VM” solution here Pi-hole in Canonical LXD container

1 Like

Could someone mark this thread as Solved?

1 Like