Force safe search in search engines


  1. Posts : 26
    Windows 7 Pro x64
       #1

    Force safe search in search engines


    I'd like to force google (and other popular search engines) to use strict safe search for parental control reasons via the hosts file, so if anyone knows the correct ip address's/domains i'd appreciate it.
      My Computer


  2. Posts : 3,785
    win 8 32 bit
       #2

    What is safe search? What's safe for one person may not be for another using opedns may do what you want
      My Computer


  3. Posts : 26
    Windows 7 Pro x64
    Thread Starter
       #3

    Meaning it will block adult content automatically
      My Computer


  4. Posts : 25,847
    Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64
       #4

    Take a read through this tutorial by Brink.

    Parental Controls - Setup and Use
      My Computer


  5. Posts : 26
    Windows 7 Pro x64
    Thread Starter
       #5

    Can someone do me a favor if you have a VM ready to go? I found this bat file online but it doesn't work for me, so I'd like to make sure it's not my machine and it actually doesn't work.




    contents
    Code:
    @echo off
    findstr "216.239.38.120 www.google.com" C:\Windows\System32\drivers\etc\hosts
    if %errorlevel%==0 (
    goto end
    )
    @echo #forcesafesearch>> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com>> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 Google >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.bd >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.be >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.bf >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.bg >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.bh >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.bi >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.bj >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.bn >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.bo >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.br >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.bs >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.bt >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.bw >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.by >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.bz >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ca >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.cd >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.cf >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.cg >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ch >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ci >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.ck >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.cl >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.cm >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.cn >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.co >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.cr >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.cu >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.cv >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.cy >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.cz >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.de >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.dj >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.dk >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.dm >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.do >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.dz >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.ec >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ee >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.eg >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.es >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.et >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.fi >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.fj >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.fm >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.fr >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ga >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ge >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.gg >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.gh >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.gi >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.gl >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.gm >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.gp >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.gr >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.gt >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.gy >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.hk >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.hn >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.hr >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ht >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.hu >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.id >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ie >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.il >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.im >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.in >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.iq >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.is >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.it >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.je >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.jm >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.jo >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.jp >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.ke >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.kh >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ki >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.kg >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.kr >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.kw >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.kz >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.la >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.lb >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.li >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.lk >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.ls >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.lt >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.lu >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.lv >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.ly >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.ma >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.md >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.me >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.mg >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.mk >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ml >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.mm >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.mn >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ms >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.mt >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.mu >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.mv >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.mw >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.mx >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.my >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.mz >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.na >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.nf >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.ng >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.ni >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ne >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.nl >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.no >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.np >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.nr >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.nu >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.nz >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.om >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.pa >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.pe >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.pg >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.ph >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.pk >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.pl >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.pn >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.pr >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ps >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.pt >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.py >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.qa >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ro >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ru >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.rw >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.sa >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.sb >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.sc >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.se >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.sg >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.sh >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.si >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.sk >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.sl >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.sn >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.so >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.sm >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.sr >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.st >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.sv >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.td >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.tg >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.th >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.tj >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.tk >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.tl >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.tm >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.tn >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.to >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.tr >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.tt >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.tw >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.tz >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.ua >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.ug >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.uk >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.uy >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.uz >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.vc >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.ve >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.vg >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.vi >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.com.vn >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.vu >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.ws >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.rs >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.za >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.zm >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.co.zw >> C:\Windows\System32\drivers\etc\hosts
    @echo 216.239.38.120 www.google.cat>> C:\Windows\System32\drivers\etc\hosts
    @echo #end of forcesafesearch>> C:\Windows\System32\drivers\etc\hosts
    Last edited by z3r010; 06 Nov 2016 at 06:06. Reason: removed file hosted malware domain
      My Computer


  6. Posts : 3,785
    win 8 32 bit
       #6

    The problem is that only Google so they can use any other search you don't have this problem using open DNS it's a catch all
      My Computer


  7. Posts : 26
    Windows 7 Pro x64
    Thread Starter
       #7

    samuria said:
    The problem is that only Google so they can use any other search you don't have this problem using open DNS it's a catch all
    I do have OpenDNS and DNSCrypt, plus I'm blocking a big list of other search engines... I just wish that bat file would work. I don't want to manually add all those google domains if I can help it
      My Computer


  8. Posts : 31,249
    Windows 11 Pro x64 [Latest Release and Release Preview]
       #8

    OpenDNS is the way to go as the issue you are attempting to solve is an extremely fluid one, In a situation where the "bad" sites are changing continuously your filters have to do the same, and although this is not actually possible, a major site such as as OpenDNS, will always be "better" than any one person can achieve.

    I would also set up Family Safety / Parental controls to use a whitelist suitable for the age of your Children, (either an account each or a single account suitable for the youngest), / your wishes ( there are lists available online but the actual choice must always be yours) - if they wish to visit a site not in the Whitelist they will need to ask you, and you can check the site and decide.

    This is a draconian measure but is the safest method available (rather than block the sites that are not allowed' (that you are aware of), you only allow those you are happy with after you have checked. If one of the children should circumvent the system in some way then the OpenDNS system, (Correctly set-up) works as a catch all to prevent issues.

    The parental controls can also control a lot of the functionality of windows and also the software that the child is able to run (also available as a WhiteList, rather than a blacklist), so gives another layer of protection.

    One other thing, If one of your Whitelist sites should become hacked or otherwise not meet content acceptance levels you have set in OpenDNS then it will be blocked for you automatically
      My Computers


  9. Posts : 26
    Windows 7 Pro x64
    Thread Starter
       #9

    I appreciate the comments, but what I want to do (Original Post) works very well alongside OpenDNS...I only have a couple things to figure out...
    #1 When I try to redirect other popular search engines to google (safe search) I get a 404 error, now it still technically solves my issue with blocking other search engines, but I wish it just redirected them to google with safe search forced (no adult content/images will show)

    #2 I would like to confirm that the bat file I posted either works (something in my machine is blocking it) or it doesn't work (does someone here know how to create one that works with all of google's domains added to the hosts file? I'd really appreciate that)

    Now let me show you what happens if someone were to try to search for adult stuff (typically porn etc)

    Results (images)

    The images in the link above clearly shows that no adult content can be viewed in google/youtube, now nothing is 100%, but this should do the trick along with my custom settings in OpenDNS. THE COOL THING IS, I DON'T HAVE TO INSTALL ANYTHING!
    I almost forgot, I have this same setup on my son's pc's, the only difference from our Family PC is I use a neat utily called DNS Angel and I use Yandex DNS which also forces safe search on google.

    This what my hosts file looks like for anyone interested...
    I have to add more google domains either manually or with a bat file (if someone can show me how to make it or create it for me I'd be very grateful)


    images
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 12:33.
Find Us