Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alialmasi/unforce-safesearch
How to unforce Google SafeSearch
https://github.com/alialmasi/unforce-safesearch
dns filternet google internet iran netwokring safesearch
Last synced: 23 days ago
JSON representation
How to unforce Google SafeSearch
- Host: GitHub
- URL: https://github.com/alialmasi/unforce-safesearch
- Owner: AliAlmasi
- Created: 2023-06-06T22:29:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-07T22:13:42.000Z (8 months ago)
- Last Synced: 2024-05-07T23:24:55.504Z (8 months ago)
- Topics: dns, filternet, google, internet, iran, netwokring, safesearch
- Homepage: https://medium.com/@a710almasi/unforce-google-safesearch-4fad58946429?source=friends_link&sk=5d258f46935938d49669708a90ba96e2
- Size: 189 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Unforce Google SafeSearch
Recently, the Iranian government has made changes in the national DNS servers, which causes all DNS requests for Google to be sent to the domain
forcesafesearch.google.com
(to IP216.239.38.120
), which forces all Google users, regardless of their settings, to use Google with the SafeSearch on.UPDATE - BING IS POISONED TOO:
This user's issue shows that not only Google, but also Bing has been forcibly placed on SafeSearch for Iranian users. Therefore, we put the necessary codes to bypass the restriction placed on Bing inside this text. If you have done the settings related to Google in the past, you can only put the part related to Bing in the
resolv.conf
file in Linux and Mac orhosts
file in Windows.If you see similar problems regarding forcing SafeSearch for Iranian users on other search engines, you can register the case in the Issues section of this repository so that it can be included in this guide. Your contribution may help many people behind Iran's Filternet.
How to bypass this?
To bypass this, the system must manually introduce Google's regular search servers (
google.com
-142.250.180.142
). For this, it is necessary to use thehosts
file available in the operating systems to introduce the IP directly to the system so that it does not request Google's safe search from the country's DNS.Notice: This solution only works in Windows, macOS and Linux.For Windows users
On Windows, you need to open the Run window (WinKey + R) and type this as administrator:
notepad C:\Windows\System32\Drivers\etc\hostsThis will open the
hosts
file of your Windows on a Notepad.Next, you need to add these lines at the end of the file:
142.250.180.142 google.com
142.250.180.142 www.google.com
13.107.21.200 bing.com
13.107.21.200 www.bing.comSave the file afterward, open cmd and flush the DNS cache by running
ipconfig /flushdnsNow you're all done. Check if it's working by opening google.com, or run
nslookup google.com
on cmd and see what IP it returns.For macOS users
Open Terminal and run
sudo nano /private/etc/hostsSince we use sudo to edit the hosts file, you will be asked to enter the administrator password of your macOS user account. Type your admin password and hit the Enter key.
Note: The cursor doesn’t work in the command line. You'll need to use the arrow keys to navigate between the lines inside the hosts file.Paste these lines at the end of the file:
142.250.180.142 google.com
142.250.180.142 www.google.com
13.107.21.200 bing.com
13.107.21.200 www.bing.comAfter that, press CTRL + X on your keyboard. Enter Y to save the changes, and hit the Enter button.
Then, you'll need to flush the DNS cache. to do this, if you're using macOS Monterey or Big Sur, run this:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderElse, if you're using macOS Catalina, Mojave, High Sierra, Sierra, Mountain Lion or Lion, run this:sudo killall -HUP mDNSResponderNow you're all done. Check if it's working by opening google.com, or run
nslookup google.com
on your Terminal and see what IP it returns.For Linux users
Open Terminal and run this:
sudo nano /etc/hostsEnter the password for sudo when asked.Paste these lines at the end of the file:
142.250.180.142 google.com
142.250.180.142 www.google.com
13.107.21.200 bing.com
13.107.21.200 www.bing.comAfter that, press CTRL + X on your keyboard. Enter Y to save the changes, and hit the Enter button.
Then, to flush the DNS cache on Linux, if you are using
systemd-resolved
, you can use the command followed by--flush-caches
.
Alternatively, you can use theresolvectl
command followed by theflush-caches
option.sudo systemd-resolve --flush-caches
sudo resolvectl flush-cachesYou can also restart the nscd if you're using that, by running this command:
sudo /etc/init.d/nscd restartNow you're all done. Check if it's working by opening google.com, or run
nslookup google.com
on your Terminal and see what IP it returns.