How-to Updated

Block ads and trackers for the whole house with DNS

A DNS filter stops known tracking domains before a page loads, on every device, including the television. It is also easy to get wrong.

· Tested on 4 homes · 3 min read

Difficulty
Advanced
Time
40 minutes
Steps
7 steps
You’ll need
A spare always-on machine or small server
A small computer and a router on a shelf in a cupboard.

A DNS filter is not a magic shield. It stops requests to names on a list, so it will not remove an advert served from the site’s own domain, and it cannot see inside encrypted pages. What it does well is quiet the background noise that devices make all day.

DNS is the phone book of the internet: every device asks it for the address of a name. A filter that answers “nothing here” for known tracking and advert domains blocks them on every device in the house, including those you cannot install software on. This guide uses Lantern DNS, a small open-source filter.

Pick the machine

You need something always on and wired by cable: a spare laptop, a small mini-PC or a home server. It does not need to be powerful: 2 GB of memory is enough. Give it a fixed address in the router first, for example 192.168.1.20.

Install the filter

On the machine, run:

curl -fsSL https://get.lanterndns.example/install.sh -o install.sh
less install.sh
sh install.sh

Reading the script first is not paranoia. It is the habit you want for anything that runs as an administrator.

Choose your lists

Open the admin page at http://192.168.1.20:3000 and add two or three block lists. Fewer is better: each extra list adds false positives, and you will spend more time unbreaking pages than you gain.

lantern list add --name core --url https://lists.lanterndns.example/core.txt
lantern list update
lantern stats

Start gentle

Begin with one list and use it for a week. Add a second only if you see trackers getting through.

Test it on one device

Do not change the whole router yet. Set your laptop’s DNS to 192.168.1.20 and run:

nslookup tracker.example.test 192.168.1.20

A blocked name returns 0.0.0.0. A normal name returns its real address. Open a few shopping and news sites and check they still work.

Point the router at it

In your router’s admin page set Primary DNS to 192.168.1.20. Set the second field to the same address, not to a public one: a public fallback quietly bypasses the filter whenever the first one is slow.

Plan for the day it breaks

Think about who else lives in the house. A partner who cannot reach a favourite site at ten at night will not care that it was on a list for good reason. Agree in advance where the allow list lives and who may add to it.

When the machine is off, every device on the network loses the internet. Decide in advance: either keep a second filter on another machine, or know exactly where the router’s DNS setting is and how to clear it.

Write down the undo

Put the steps to switch DNS back on a note on the fridge. The first outage always happens when you are not at home.

Review monthly

Also look at which device makes the most requests. A smart television that asks for the same name 4,000 times a day is a better argument for a guest network than any list.

Look at the top blocked names and at what you had to allow. If one site keeps breaking, add it to the allow list and move on. Also read locking down your router so the admin page itself is not exposed.

Did this guide work for you?

98 people said it worked

Comments

Write a comment