:: BA.net/adblock DNS for IPv4 on Windows Server 2000/2003/2008 & :: Windows XP/Vista/7/8 @ECHO OFF SETLOCAL EnableDelayedExpansion SET adapterName= FOR /F "tokens=* delims=:" %%a IN ('IPCONFIG ^| FIND /I "ETHERNET ADAPTER"') DO ( SET adapterName=%%a REM Removes "Ethernet adapter" from the front of the adapter name SET adapterName=!adapterName:~17! REM Removes the colon from the end of the adapter name SET adapterName=!adapterName:~0,-1! netsh interface ipv4 set dns name="!adapterName!" static 104.131.230.202 primary netsh interface ipv4 add dns name="!adapterName!" 104.236.166.10 index=2 netsh interface ipv4 add dns name="!adapterName!" 104.236.64.166 index=3 ) SET adapterName= FOR /F "tokens=* delims=:" %%a IN ('IPCONFIG ^| FIND /I "WIRELESS ADAPTER"') DO ( SET adapterName=%%a REM Removes "Ethernet adapter" from the front of the adapter name SET adapterName=!adapterName:~17! REM Removes the colon from the end of the adapter name SET adapterName=!adapterName:~0,-1! netsh interface ipv4 set dns name="!adapterName!" static 104.131.230.202 primary netsh interface ipv4 add dns name="!adapterName!" 104.236.166.10 index=2 netsh interface ipv4 add dns name="!adapterName!" 104.236.64.166 index=3 ) SET adapterName= FOR /F "tokens=* delims=:" %%a IN ('IPCONFIG ^| FIND /I "Adaptador DE ETHERNET"') DO ( SET adapterName=%%a REM Removes "Ethernet adapter" from the front of the adapter name SET adapterName=!adapterName:~22! REM Removes the colon from the end of the adapter name SET adapterName=!adapterName:~0,-1! netsh interface ipv4 set dns name="!adapterName!" static 104.131.230.202 primary netsh interface ipv4 add dns name="!adapterName!" 104.236.166.10 index=2 netsh interface ipv4 add dns name="!adapterName!" 104.236.64.166 index=3 ) SET adapterName= FOR /F "tokens=* delims=:" %%a IN ('IPCONFIG ^| FIND /I "ADAPTADOR LAN inalàmbrico"') DO ( SET adapterName=%%a REM Removes "Ethernet adapter" from the front of the adapter name SET adapterName=!adapterName:~26! REM Removes the colon from the end of the adapter name SET adapterName=!adapterName:~0,-1! netsh interface ipv4 set dns name="!adapterName!" static 104.131.230.202 primary netsh interface ipv4 add dns name="!adapterName!" 104.236.166.10 index=2 netsh interface ipv4 add dns name="!adapterName!" 104.236.64.166 index=3 ) ipconfig /flushdns ECHO. ECHO If you see and error above make sure you run the command ECHO with RIGHT MOUSE CLICK and choose RUN AS ADMINISTRATOR ECHO. pause :EOF