Force Google SafeSearch on Lede 17.01.4

Hi,

This is the entry I have in my /etc/config/dhcp to force google safesearch:
config tag 'kids'
list address '/www.google.com/216.239.38.120'
list address '/www.google.ca/216.239.38.120'

I run linux on all my home machines but it doesn't matter which one I run it never forces google safesearch. As you can see I am a total newb!

Strangely this entry works:
list address '/restrictmoderate.youtube.com/216.239.38.119'
also under config tag 'kids'.

The machine I am testing this on has the kids flag:
config host
option name 'craig-desktop-Mate'
option mac 'xx:xx:xx:xx:xx:xx'
option ip 'xxx.xxx.x.xxx'
option tag 'kids'

The clients are using which DNS server?

Its OK...if that's what you are attempting to do, your list address configs will not accomplish that. Your config states that: DNS server 216.239.38.119 should be used to look up domain X.

Screenshot%20from%202018-09-26%2010-48-36

I have my DNS set to the open DNS servers. Not being at home right now I believe they are 208.67.222.222 and 208.67.220.220

I like the idea of using the DHCP to hand out the static lease to those clients. Then the list address would work? I will hopefully give it a go tonight

No, as I noted, list address will not work. That is not the proper config.

If you use static leasing to hand out the DNS servers, you would follow the instructions at the link provided. The config would be option dns:

config host
	option ip '192.168.1.2'
	option mac '00:11:22:33:44:55'
	option name 'mypc'
	option dns '216.239.38.120'

Can I set multiple DNS per static IP in that case? Cause I want Google safe search, open DNS, safe YouTube, safe Bing, etc.

Yes; but I'm certain you won't get the desired effect, since this servers are managed by different providers - blocking different domains.

Also, here is the correct method (I realized option dns was a Boolean value):

config host
	option ip '192.168.1.2'
	option mac '00:11:22:33:44:55'
	option name 'mypc'
	option dns '1'
	option tag 'kids_dns'

config tag 'kids_dns'
	list dhcp_option '6,216.239.38.120,208.67.222.123,208.67.220.123'

Hope this helps.

1 Like

Thanks so much I look forward to trying this out

ok still having problems here. I tried to just set one DNS for one computer as follows:

config tag 'test_dns'
        list dhcp_option '6,216.239.38.120'

config host
        option name 'test-pc'
        option mac 'xx:xx:xx:xx:xx:xx'
        option ip '192.168.x.xxx'
        option dns '1'
        option tag 'test_dns'

cleared the cache in firefox, also forgot the wireless network and then re-logged into it (so it would show a new DNS) and still when I go to google it does not force the google safesearch

Did you let that device get a new DHCP lease, though?

:wink:

1 Like

In upcoming versions of OpenWRT there will be a package called safe-search that can be installed. Until then, try this:

create a file called /etc/config/safe-search-hosts/google

in that file, copy and paste from:

Next, in /etc/config/dhcp you'll want to add a line to the dnsmasq section:

config dnsmasq
        list addnhosts '/etc/config/safe-search-hosts'

Finally, run "/etc/init.d/dnsmasq reload" to make safe search active.

You may need to reboot computers on your network or flush the dns on them before they'll pick up the changes.

suddenly

2 Likes

In upcoming versions of OpenWRT there will be a package called safe-search that can be installed

Oh that'll be nice! does anyone know how much longer before it's out in the mainstream?

Hopefully in the next release. It will depend on when this pull request is merged:

1 Like

thanks farmergreg, that was the ticket. Thanks everyone for all your help!

1 Like

doing it this way must make my DNS to be the google safe search host. would that be correct?
when I run: nmcli device show | grep IP4
I get as output:
IP4.DNS[1]: 216.239.38.120

It will make google dns lookups return the ip address of forcesafesearch.google.com. When google "sees" that you're using that IP address, it automatically knows that you want safe search turned on.

By the way, the safe-search package has been merged. Look for it in the next release!

The safe-search package is now available in OpenWRT 19.07 as an official package. Enjoy!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.