Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

AIO DNS Changer

Hi Guys,

Here is something I created a while ago when I was having a few issues with content blocking, adding in different DNS settings, I have created it so that you can switch to a SmartDNS service called SmartyDNS which allows you to browse netflix and other sites without blocking, purely because it allows unlimited 14 day trials, it also includes an automatic run as admin incase you forget to run as admin.

Code
@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params = %*:"=""
    echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
    exit /B

:gotAdmin
    pushd "%CD%"
    CD /D "%~dp0"

title IP Control Manager
color 0a
:begin
cls
echo - Set Google DNS Servers - Press 1
echo.
echo - Set OpenDNS DNS Servers - Press 2
echo.
echo - Set Default DNS Servers - Press 3
echo.
echo - Set SmartyDNS DNS Servers - Press 4
echo.
echo - Validate IP for SmartyDNS - Press 5
echo.
echo - Exit Without making changes - Press 6
echo.
echo.
choice /N /C:123456 %1
IF ERRORLEVEL ==6 GOTO SIX
IF ERRORLEVEL ==5 GOTO FIVE
IF ERRORLEVEL ==4 GOTO FOUR
IF ERRORLEVEL ==3 GOTO THREE
IF ERRORLEVEL ==2 GOTO TWO
IF ERRORLEVEL ==1 GOTO ONE
GOTO END

:SIX
echo.
Echo You have selected to Quit, Is this Correct?
echo.
CHOICE /C:YN %1
IF ERRORLEVEL ==2 GOTO BEGIN
Echo Thank you for using this program
pause
GOTO END

:FIVE
echo.
Echo You have selected to Validate your IP for SmartyDNS, Correct?
echo.
CHOICE /C:YN %1
IF ERRORLEVEL ==2 GOTO BEGIN
start chrome https://smartdns.smartydns.com/index.php?smartkey=
GOTO END

:FOUR
echo.
Echo You have selected SmartyDNS, Correct?
echo.
CHOICE /C:YN %1
IF ERRORLEVEL ==2 GOTO BEGIN
ipconfig /flushdns
netsh interface ipv4 set dns name="Local Area Connection" source=static addr=87.117.205.40
IF errorlevel 1 GOTO FAULT
netsh interface ipv4 add dns name = "Local Area Connection" addr=192.241.143.47
IF errorlevel 1 GOTO FAULT
GOTO END

:THREE
echo.
ECHO You have selected Default DNS, Correct?
echo.
CHOICE /C:YN %1
IF ERRORLEVEL ==2 GOTO BEGIN
ipconfig /flushdns
netsh interface ipv4 set dns name="Local Area Connection" dhcp
IF errorlevel 1 GOTO FAULT
GOTO END

:TWO
echo.
Echo You have selected OpenDNS, Correct?
echo.
CHOICE /C:YN %1
IF ERRORLEVEL ==2 GOTO BEGIN
ipconfig /flushdns
netsh interface ipv4 set dns name="Local Area Connection" source=static addr=208.67.222.222
IF errorlevel 1 GOTO FAULT
netsh interface ipv4 add dns name = "Local Area Connection" addr=208.67.220.220
IF errorlevel 1 GOTO FAULT
GOTO END

:ONE
echo.
ECHO You have selected Google DNS, Correct?
echo.
CHOICE /C:YN %1
IF ERRORLEVEL ==2 GOTO BEGIN
ipconfig /flushdns
netsh interface ipv4 set dns name="Local Area Connection" source=static addr=8.8.8.8
IF errorlevel 1 GOTO FAULT
netsh interface ipv4 add dns name = "Local Area Connection" addr=8.8.4.4
IF errorlevel 1 GOTO FAULT
GOTO END

:FAULT
CLS
color C0
echo The command failed.
echo Check windows name for your network connection.
echo If it's not "Local Area Connection"
echo Then change each instance in this file to match your system.
pause
:END

Enjoy, and if there are any comments, please, let me know.
(Jun 3, 2016 02:45 AM)Tentacruel Wrote:  Hi Guys,

Here is something I created a while ago when I was having a few issues with content blocking, adding in different DNS settings, I have created it so that you can switch to a SmartDNS service called SmartyDNS which allows you to browse netflix and other sites without blocking, purely because it allows unlimited 14 day trials, it also includes an automatic run as admin incase you forget to run as admin.
Enjoy, and if there are any comments, please, let me know.

im gonna come back and read this later cuz i g2g but im glad to see you know about netsh, i skimmed your code and looks like unlike alot of these youtube-level rookies on here u actually know what youre talking about
I am not flaming or bashing. I just have a question.

Why are those IP addresses hardcoded? And who owns that IP? Shouldn't it be dynamic? I'm unfamiliar with netsh.
Code
netsh interface ipv4 set dns name="Local Area Connection" source=static addr=87.117.205.40
IF errorlevel 1 GOTO FAULT
netsh interface ipv4 add dns name = "Local Area Connection" addr=192.241.143.47

netsh interface ipv4 set dns name="Local Area Connection" source=static addr=208.67.222.222
IF errorlevel 1 GOTO FAULT
netsh interface ipv4 add dns name = "Local Area Connection" addr=208.67.220.220

As far as this one however. Isn't this google's DNS? Or something along those lines.
Code
netsh interface ipv4 set dns name="Local Area Connection" source=static addr=8.8.8.8
IF errorlevel 1 GOTO FAULT
netsh interface ipv4 add dns name = "Local Area Connection" addr=8.8.4.4
(Jun 3, 2016 10:11 PM)ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ Wrote:  I am not flaming or bashing. I just have a question.

Why are those IP addresses hardcoded? And who owns that IP? Shouldn't it be dynamic? I'm unfamiliar with netsh.
Code
netsh interface ipv4 set dns name="Local Area Connection" source=static addr=87.117.205.40
IF errorlevel 1 GOTO FAULT
netsh interface ipv4 add dns name = "Local Area Connection" addr=192.241.143.47

netsh interface ipv4 set dns name="Local Area Connection" source=static addr=208.67.222.222
IF errorlevel 1 GOTO FAULT
netsh interface ipv4 add dns name = "Local Area Connection" addr=208.67.220.220

As far as this one however. Isn't this google's DNS? Or something along those lines.
Code
netsh interface ipv4 set dns name="Local Area Connection" source=static addr=8.8.8.8
IF errorlevel 1 GOTO FAULT
netsh interface ipv4 add dns name = "Local Area Connection" addr=8.8.4.4

HI ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™, I basically created it for my own use, the IP addresses are all the legitimate DNS servers of the respective services, it uses netsh to modify your current DNS settings for a network adapter (I use LAN, so I have it set to Local Area Connection, if you use wireless, you'll want to change the name)

In response to your first question, the first set of IP's is for a smart DNS service called SmartyDNS that I used to watch netflix, as I'm not located in the US, and the US has a much better selection, without having to resort to a VPN, The second set of IP's is for OpenDNS, a well respected DNS service, and the third set you have listed are in fact Google's DNS servers, all of which are labelled both in the main selection area, and in the confirmation of your choice.

1) Google DNS
2) OpenDNS
3) DCHP set DNS Server
4) SmartyDNS (Paid for Smart DNS)
5) Validate your IP address for SmartyDNS (IP Locked, this is a setting for Dynamic IP users such as myself, they insert the key into the URL, and it opens chrome and navigates to the validation page)
6) Exit without changes.

I hope this helped solve your questions in regards to the script.
(Jun 5, 2016 04:12 AM)Tentacruel Wrote:  snip

Thank you for a well detailed response! It's quite interesting sir. Keep up the good work!
I'm guessing this only works for Local Area Connection?
(Jun 5, 2016 10:50 PM)Demοn Wrote:  I'm guessing this only works for Local Area Connection?
This can work for any network connection,

All you have to do is find the name of your current network connection, E.G. Local Area Connection or Wireless Connection 4 for example, do a find and replace; and replace each instance of Local Area Connection to your current network connection.
Thanks bro, It worked for me. Thank you very much !
Looks great. As i have no need to change dns settings anytime soon, i cannot vouch for how successful it is. However it does look great and based on other's responses it appears to work. Great release OP
This vbscript can change your defaults DNS to OpenDNS and of course you can easily roll back to your defaults settings :

It worked for me. thanks for upload
This looks amazing! Thanks for sharing OP!


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by HackooSep 28, 2017 12:14 AM 6 324 Sep 28, 2017 12:14 AM
Last Post: Hackoo
[Shell] by HackooNov 29, 2016 07:55 PM 7 376 Nov 29, 2016 07:55 PM
Last Post: Hackoo
[.NET] by DuguWudiJun 26, 2014 02:18 AM 2 253 Jun 26, 2014 02:18 AM
Last Post: DuguWudi