Skip navigation

I don’t have time to explain in depth how to set up OpenWRT in general. For you geeks who have already done it, here’s how you can block your smart TV and un-rooted phones and other devices from getting YouTube ads using your router!

In LuCI, go to Network – Firewall – Custom Rules and add this (change 192.168.0.1 to your router’s LAN IP address) and add this line and save/submit:

iptables -A PREROUTING -t nat -p udp --dport 53 -i br-lan -j DNAT --to 192.168.0.1:53

Add the following entries to /etc/hosts (change 192.168.0.1 to your router’s LAN IP address, or try 0.0.0.0 instead):

192.168.0.1 doubleclick.net
192.168.0.1 googleadservices.com
192.168.0.1 pagead2.googlesyndication.com
192.168.0.1 pubads.g.doubleclick.net
192.168.0.1 partnerad.l.doubleclick.net
192.168.0.1 beacons.extremereach.io
192.168.0.1 secure-us.imrworldwide.com
192.168.0.1 sb.scorecardresearch.com
192.168.0.1 secure.insightexpressai.com
192.168.0.1 googleads.g.doubleclick.net
192.168.0.1 ad.doubleclick.net
192.168.0.1 dart.l.doubleclick.net
192.168.0.1 dts.innovid.com
192.168.0.1 s0.2mdn.net

Google has a big list of ad servers so there may be more that I’ve missed, but after blocking these hosts I saw the ads stop without other problems.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: