Question came from a user on the Youtube community on how to force Google Safe Search for their network.
SafeSearch is a feature in Google Search and Google Images that acts as an automated filter of pornography and potentially offensive and inappropriate content. On November 11, 2009, Google introduced the ability for users with Google Accounts to lock on the SafeSearch level in Google’s web and image searches.
There are multiple ways to implement SafeSearch enforcement, and we will address the two easiest method:
Method 1: Using Windows DNS hosts file
Follow these steps to force Google SafeSearch on Windows machines:
- In Windows, click the Windows key and type
- Right click on Notepad and choose
Run as Administrator.
Yeswhen Windows asks if you want this program to make changes.
- In Notepad, open your hosts file. In most Windows installations, this is located at:
- Click the Windows key, type
cmdand hit enter. This will open Command Prompt.
- Enter the command
ping forcesafesearch.google.comand note the IP address. The IP address will look something like:
- Create an entry at the end of hosts file with the IP address you obtained. For example:
126.96.36.199 www.google.com #forcesafesearch.
- Save the hosts file.
To confirm SafeSearch is on, open Google.com and check that SafeSearch is on by default and can’t be turned off.
Method 2: Using Pi-Hole DNS server
If you are running Pi-Hole server on Windows or Linux , you can follow these steps to enforce Google SafeSearch using Local DNS server, the benefit of this method that all client on your network will benefit from this enforcement, whereas method 1 must be applied to Windows clients one by one, no solution for mobile clients either.
- Using Windows CMD or Linux Terminal, enter the command
ping forcesafesearch.google.comand note the IP address. The IP address will look something like: 188.8.131.52.
- Login to your Pi-Hole server using the Web UI (GUI).
- Go to Local DNS from menu on the left -> DNS Records.
- Create an entry: Domain
google.comand IP address
- You may need to wait for DNS cache (Local, Browser or Pi-Hole itself) to expire in order for you to see the effect.