Saturday, September 5, 2020

More safe browsing with RaspberryPi and PiHole

To restrict access to unwanted websites:

 Go To PiHole Settings -> DNS->Upstream DNS Servers

I use the upstream DNS servers provided by https://cleanbrowsing.org/filters

Enter the IPs provided by CleanBrowsing into the IPv6 and IPv4 input fields

Scroll down to Advanced DNS settings and enable these

  • Never forward non-FQDNs
  • Never forward reverse lookups for private IP ranges (only if you use PiHole as your DHCP server instead of your router)
  • Use DNSSEC

Safe Search with Raspberry Pi and PiHole

 Instructions adapted from this thread: https://discourse.pi-hole.net/t/use-dns-to-force-youtube-into-restricted-mode-and-pi-hole/1996/23

Add these to /etc/hosts

216.239.38.119  restrictmoderate.youtube.com
216.239.38.120  forcesafesearch.google.com
204.79.197.220  strict.bing.com
52.149.247.1    safe.duckduckgo.com
2001:4860:4802:32::77 restrictmoderate.youtube.com
2001:4860:4802:32::78 forcesafesearch.google.com

create this file  /etc/dnsmasq.d/05-restrict.conf with these lines

# YouTube
cname=www.youtube.com,restrictmoderate.youtube.com
cname=m.youtube.com,restrictmoderate.youtube.com
cname=youtubei.googleapis.com,restrictmoderate.youtube.com
cname=youtube.googleapis.com,restrictmoderate.youtube.com
cname=www.youtube-nocookie.com,restrictmoderate.youtube.com

# SafeSearch
cname=www.google.com,forcesafesearch.google.com

# Bing Family Filter
cname=www.bing.com,strict.bing.com

# DuckDuckGo Filter
cname=www.duckduckgo.com,safe.duckduckgo.com
cname=duckduckgo.com,safe.duckduckgo.com

Finally restart PiHole. Tested with PiHole 5.1.2