What's new

Force Google SafeSearch

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

hayedid

Occasional Visitor
Hello. I've done some research, and as I understand it, adding a CNAME entry for www.google.com to forcesafesearch.google.com should force google safe search for any searches.

So, I enabled JFFS configs, and created a dnsmasq.conf.add file and put in the following entry.

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

However, this does not appear to be working.

Has anyone done this before or know how to get it working?

Thank you.
 
Hello. I've done some research, and as I understand it, adding a CNAME entry for www.google.com to forcesafesearch.google.com should force google safe search for any searches.

So, I enabled JFFS configs, and created a dnsmasq.conf.add file and put in the following entry.

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

However, this does not appear to be working.

Has anyone done this before or know how to get it working?

Thank you.

This should get you what you're after:
https://support.opendns.com/entries/57304954-Enforcing-Google-SafeSearch

more specifically the entry:
address=/www.google.com/216.239.38.120
 
Hello. I've done some research, and as I understand it, adding a CNAME entry for www.google.com to forcesafesearch.google.com should force google safe search for any searches.

So, I enabled JFFS configs, and created a dnsmasq.conf.add file and put in the following entry.

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

However, this does not appear to be working.

Has anyone done this before or know how to get it working?

Thank you.

That won't work with just a dnsmasq config entry. As per dnsmasq's manpage, the target must be known either by the DHCP server, or be defined in the hosts file - it cannot be something requiring resolution from an upstream (or recursive) server. So in addition to dnsmasq.conf.add, you must also add a host entry for forcesafesearch.

Since Cloudflare is being paranoid, I've went ahead and created a Wiki page explaining the required steps:

https://github.com/RMerl/asuswrt-merlin/wiki/Enforce-Safesearch
 
Last edited:
Thank you so much for your reply! I used the hosts method to get this working on my mac, but, of course, it doesn't extend to tablets, ipods, etc...

I can't get the address=/www.google.com/216.239.38.120 entry to work. When I ping www.google.com, it still gets the normal address.

Here is what I did:
(1) Admin / Enable JFFS custom scripts and configs - set to YES
(2) cd /jffs/configs
(3) vi dnsmasq.conf.add
(4) added:
address=/www.google.com/216.239.38.120
(5) ESC, :wq
(6) reboot router
(7) ping www.google.com from PC and it does not go to 216.239.38.120

Any ideas?

Thanks you.
 
Thank you so much for your reply! I used the hosts method to get this working on my mac, but, of course, it doesn't extend to tablets, ipods, etc...

I can't get the address=/www.google.com/216.239.38.120 entry to work. When I ping www.google.com, it still gets the normal address.

Here is what I did:
(1) Admin / Enable JFFS custom scripts and configs - set to YES
(2) cd /jffs/configs
(3) vi dnsmasq.conf.add
(4) added:
address=/www.google.com/216.239.38.120
(5) ESC, :wq
(6) reboot router
(7) ping www.google.com from PC and it does not go to 216.239.38.120

Any ideas?

Thanks you.

Make sure your PC uses your router's IP for its DNS.

I only tested the cname + host method myself.

Either method should work fine regardless of if it's a computer or a router (the cname + host method requires both changes to be done on the router, not on the clients).
 
I had tested my method as well which worked. Make sure to clear any cached entries you might have had on your PC by issuing the following command from the command prompt: ipconfig /flushdns
 
Thank you all so much! It is working great. I had done a flushdns, but it must have still been cached somewhere. I did a flush dns, then rebooted my modem, router, and computer and it is now working!

Thank you!!!!
 
like this:

address=/www.google.co.uk/216.239.38.120
address=/www.google.ca/216.239.38.120
address=/www.google.fr/216.239.38.120
address=/www.google.it/216.239.38.120
address=/www.google.es/216.239.38.120
address=/www.google.nl/216.239.38.120
.....
 
Thank you all so much! It is working great. I had done a flushdns, but it must have still been cached somewhere. I did a flush dns, then rebooted my modem, router, and computer and it is now working!

Thank you!!!!

One thing to keep in mind BTW is that many browsers also have their own internal DNS cache. It's starting to be a bit silly if you ask me. The typical home user now has:

- Chrome cacheing DNS queries
- Windows cacheing DNS queries
- The router cacheing DNS queries
- The ISP cacheing DNS queries

That's a lot of stages where you can run into problems when dealing with DNS-related changes...
 
One thing to keep in mind BTW is that many browsers also have their own internal DNS cache. It's starting to be a bit silly if you ask me. The typical home user now has:

- Chrome cacheing DNS queries
- Windows cacheing DNS queries
- The router cacheing DNS queries
- The ISP cacheing DNS queries

That's a lot of stages where you can run into problems when dealing with DNS-related changes...

Hmm, how about to clear this cache, if one change DNS things..
Like for chrome on:
chrome://net-internals/#dns

Do you say, it´s unsafe to force google safesearch with the instruction in this thread?
 
Hmm, how about to clear this cache, if one change DNS things..
Like for chrome on:
chrome://net-internals/#dns

Do you say, it´s unsafe to force google safesearch with the instruction in this thread?

Not at all. Just saying that, when playing with DNS entries, it's usually best to reboot computers and routers to flush out anything cached on your local network. Or, if you are techsavvy enough, you need to restart the dnsmasq service on the router, flush Windows' DNS cache with ipconfig /flushdns, and completely restart your browser.
 
While I like the idea of enforcing safe search, the problem is I am using the parental controls to force the devices my children use to go via OpenDNS.

Will the dnsmasq changes work in conjunction with OpenDNS, or (as is my understanding) will I need to use the router for DNS services so that the dnsmasq settings are used?
 
While I like the idea of enforcing safe search, the problem is I am using the parental controls to force the devices my children use to go via OpenDNS.

Will the dnsmasq changes work in conjunction with OpenDNS, or (as is my understanding) will I need to use the router for DNS services so that the dnsmasq settings are used?

You will have to test it, but in theory it should work. If you use DNSFIlter, the computer's DNS query is first sent to dnsmasq, which will immediately resolve it when it's one of the aliased Google sites. Only unresolved entries are then forwarded upstream, in which case those recursive queries are forced through OpenDNS's resolvers.
 
While I like the idea of enforcing safe search, the problem is I am using the parental controls to force the devices my children use to go via OpenDNS.

Will the dnsmasq changes work in conjunction with OpenDNS, or (as is my understanding) will I need to use the router for DNS services so that the dnsmasq settings are used?

I'm using OpenDNS for my DNS services (though not via the Parental Controls) and yes the Safe Search works in conjunction with it.
 
This is not working anymore after I´ve updated to 378.53 (on AC68U). I tried both methods (with and without host.add method).... :/

Please help.
 
This is not working anymore after I´ve updated to 378.53 (on AC68U). I tried both methods (with and without host.add method).... :/

Please help.

Works for me. Don't forget to flush your computer's DNS cache, or to reboot it.
 
Tried now not working for me. Flushed dns cache with "ipconfig /flushdns" and on "chrome://net-internals/#dns".

What I have done 5 minutes ago:

-Deleted /jffs/configs/dnsmasq.conf.add and hosts.add
-cd /jffs/configs/
-vi dnsmasq.conf.add
-put in: "cname=www.google.com,forcesafesearch.google.com"
-:w
-:q
-vi hosts.add
-put in: "216.239.38.120 forcesafesearch.google.com"
-:w
-:q
-service restart_dnsmasq
-flush dns cache on windows and chrome
(and/or restart pc and router)
-tested with nslookup www.google.com (or browser)

-> Not working for me :(

I hope the steps are correct. (Tested also Method 2 without "hosts.add")


With earlier version of Merlin it is working. Hm..
 

Post the content of System Log when you restart dnsmasq.
 
  • Like
Reactions: sam

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top