Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal
- rem Define the local IP address to which Google domains will be redirected
- set local_ip=127.0.0.1
- rem List of Google domains to block
- set domains=www.google.com google.com www.google.co.in google.co.in
- rem Location of the hosts file
- set hosts_file=%SystemRoot%\System32\drivers\etc\hosts
- rem Add entries to the hosts file to block Google domains
- echo Blocking Google domains...
- for %%d in (%domains%) do (
- echo %local_ip% %%d >> %hosts_file%
- )
- rem Flush DNS cache to apply changes
- ipconfig /flushdns
- echo Google has been blocked.
- endlocal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement