Skip to content

Instantly share code, notes, and snippets.

@Domon
Last active December 15, 2015 01:29
Show Gist options
  • Save Domon/5180629 to your computer and use it in GitHub Desktop.
Save Domon/5180629 to your computer and use it in GitHub Desktop.
Blocking ETtoday and NOWnews in hosts file on Windows
@echo off
title Blocking ETtoday and NOWnews in hosts file
:q1
set /P choice="Would you like to block ETtoday? (y/n)"
if "%choice%" == "y" goto ettoday
if "%choice%" == "n" goto q2
goto q1
:ettoday
echo 127.0.0.1 www.ettoday.net>> %WinDir%\system32\drivers\etc\hosts
:q2
set /P choice="Would you like to block NOWnews? (y/n)"
if "%choice%" == "y" goto nownews
if "%choice%" == "n" goto flushdns
:nownews
echo 127.0.0.1 www.nownews.com>> %WinDir%\system32\drivers\etc\hosts
:flushdns
echo Flushing DNS...
ipconfig /flushdns > NUL
pause
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment