What this 'should' do, is essentially filter out mature content from YouTube. For example, on my tablet when I let my kids use it, I cna go into YouTube preferences and flip on the Restricted tab, and if they try to access a flagged video, it blocks them. What I want is for this function to just always work on my devices, without needing to turn on settings in each users browser.
Ah, --test helped. I should have noticed the duplicated line, thanks.
So - now I have dnsmasq successfully restarting, but it's still not returning the right stuff.
root@pihole:~# dig @localhost www.youtube.com
; <<>> DiG 9.10.3-P4-Ubuntu <<>> @localhost www.youtube.com
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5781
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1280
;; QUESTION SECTION:
;www.youtube.com. IN A
;; ANSWER SECTION:
www.youtube.com. 300 IN A 64.233.177.190
What I've done:
added this to dnsmasq.conf:
cname=www.youtube.com,restrict.youtube.com
cname=youtube-ui.l.google.com,restrict.youtube.com
cname=m.youtube.com,restrict.youtube.com
cname=googleapis.l.google.com,restrict.youtube.com
cname=youtube.googleapis.com,restrict.youtube.com
added this to /etc/hosts:
173.194.219.190 www.youtube.com
173.194.219.100 m.youtube.com
74.125.196.95 googleapis.l.google.com
74.125.138.95 youtube.googleapis.com
173.194.219.136 youtube-ui.l.google.com
I've also created a file (/etc/hosts.mydomain) with the same records as in /etc/hosts, and added:
/etc/dnsmasq.d/02-mydns.conf:
addn-hosts=/etc/hosts.mydomain
to read in the hosts entries from hosts.mydomain
But - I still don't see restricted.youtube.com show when I dig. I feel like I'm close, but missing something small.