Script hữu ích cho việc tự động thay đổi DNS

@ECHO OFF
CLS
:LOOP
TITLE Chuong trinh ho tro thay doi DNS tu dong
ECHO === Chuong trinh ho tro thay doi DNS ===


ECHO === chuong trinh thay doi dns ===
ECHO         ............................................
ECHO.
ECHO 1. Khoi phuc DNS mac dinh
ECHO 2. Su dung OpenDNS (lua chon thay the khi khong truy cap duoc Facebook)
ECHO T. Thoat
ECHO.
SET Choice=
SET /P Choice=Nhap lua chon cua ban:
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.
IF /I '%Choice%'=='1' GOTO ItemA
IF /I '%Choice%'=='2' GOTO ItemB
IF /I '%Choice%'=='T' GOTO End
ECHO "%Choice%" is not valid. Please try again.
ECHO.
GOTO Loop
:ItemA
ECHO Dang thuc hien, ban vui long doi trong giay lat ...
netsh interface ip set dns "Local Area Connection" source=dhcp
netsh interface ip set dns "Wireless Network Connection" source=dhcp
GOTO Auto
:ItemB
ECHO Dang thuc hien, ban vui long doi trong giay lat ...
netsh interface ip set dns "Local Area Connection" static 208.67.222.222
netsh interface ip  add dns "Local Area Connection" 208.67.220.220
netsh interface ip set dns "Wireless Network Connection" static 208.67.222.222
netsh interface ip  add dns "Wireless Network Connection" 208.67.220.220
GOTO Opendns
PAUSE
CLS
GOTO Loop
:Auto
ECHO Che do dns tu dong da duoc dat.
GOTO End
:Opendns
ECHO Che do OpenDNS da duoc dat.
GOTO End
:End
PAUSE

Comments