#include <GUIConstantsEx.au3> ;thu vien cua GUI
#include <Process.au3>
#NoTrayIcon
$size = 10;
$font = "Arial"
$attribute = 3; [optional] To define italic:2 underlined:4 strike:8 char format (add together the values of all the styles required, 2+4 = italic and underlined).
$gui = GUICreate("Change DNS", 400, 400) ;Tao GUI
$btnGoogle = GUICtrlCreateButton("Google DNS", 20, 20, 70, 25) ;tao nut button
$btnDefault = GUICtrlCreateButton("DNS Default", 20, 55, 70, 25) ;tao nut button
$btnComodoDNS = GUICtrlCreateButton("Comdo DNS", 20, 90, 70, 25) ;tao nut button
$btnAdvantage = GUICtrlCreateButton("Advantage", 20, 125, 70, 25) ;tao nut button
$btnOpenDNS = GUICtrlCreateButton("Open DNS", 20, 160, 70, 25) ;tao nut button
$btnUltraDNS = GUICtrlCreateButton("Ultra DNS", 20, 195, 70, 25) ;tao nut button
$btnlevel3 = GUICtrlCreateButton("Level 3", 20, 230, 70, 25)
$btnOpenNIC = GUICtrlCreateButton("Open NIC", 20, 265, 70, 25)
$btnDNS8 = GUICtrlCreateButton("DNS 8", 20, 300, 70, 25)
$btnDNS9 = GUICtrlCreateButton("DNS 9", 155, 20, 70, 25)
$btnDNS10 = GUICtrlCreateButton("DNS 10", 155, 55, 70, 25)
$btnDNS11 = GUICtrlCreateButton("DNS 11", 155, 90, 70, 25)
$btnDNS12 = GUICtrlCreateButton("DNS 12", 155, 125, 70, 25)
$btnDNS13 = GUICtrlCreateButton("DNS 13", 155, 160, 70, 25)
$btnDNS14 = GUICtrlCreateButton("DNS 14", 155, 195, 70, 25)
$btnDNS15 = GUICtrlCreateButton("DNS 15", 155, 230, 70, 25)
$btnDNS16 = GUICtrlCreateButton("DNS 16", 155, 265, 70, 25)
GUICtrlCreateLabel("zolamua.com - nguyenthienanit@gmail.com - 01678.115.292",20,0,400,20);
GUICtrlSetFont(-1, $size, 400, $attribute, $font) ; dat font va size chu
GUISetState() ;hien thi giao dien
while 1 ; vong lap xu ly thong diep
$msg = GUIGetMsg() ; nhan thong diep
Switch $msg ; xet thong diep
Case $btnGoogle
$DNS1 = "8.8.8.8"
$DNS2 = "8.8.4.4"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnDefault
$DNS1 = "127.0.0.1"
$DNS2 = "127.0.0.1"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnComodoDNS
$DNS1 = "156.154.70.22"
$DNS2 = "156.154.71.22"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnAdvantage
$DNS1 = "156.154.70.1"
$DNS2 = "156.154.71.1"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnOpenDNS
$DNS1 = "208.67.222.222"
$DNS2 = "208.67.220.220"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnUltraDNS
$DNS1 = "204.69.234.1"
$DNS2 = "204.74.101.1"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnlevel3
$DNS1 = "4.2.2.3"
$DNS2 = "4.2.2.4"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnOpenNIC
$DNS1 = "58.6.115.42"
$DNS2 = "58.6.115.43"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnDNS8
$DNS1 = "198.77.116.225"
$DNS2 = "198.77.116.227"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnDNS9
$DNS1 = "209.244.0.3"
$DNS2 = "209.244.0.4"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnDNS10
$DNS1 = "141.211.125.17"
$DNS2 = "141.211.144.17"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnDNS11
$DNS1 = "129.250.35.250"
$DNS2 = "129.250.35.251"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnDNS12
$DNS1 = "198.77.116.221"
$DNS2 = "198.77.116.223"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnDNS13
$DNS1 = "66.244.95.20"
$DNS2 = "66.244.95.22"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnDNS14
$DNS1 = "199.45.32.37"
$DNS2 = "199.45.32.38"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnDNS15
$DNS1 = "151.202.0.84"
$DNS2 = "151.202.0.85"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $btnDNS16
$DNS1 = "205.171.2.65"
$DNS2 = "205.171.3.65"
RunWait('netsh inter ip set dns "Local Area Connection" static ' & $DNS1)
RunWait('netsh inter ip add dns "Local Area Connection" ' & $DNS2 & " index=2")
Case $GUI_EVENT_CLOSE ; xu ly su kien dong cua so
ExitLoop ; thoat khoi vong lap
EndSwitch
WEnd