`
yefeishan
  • 浏览: 108705 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
最近访客 更多访客>>
社区版块
存档分类
最新评论

set IP&DNS

 
阅读更多

In this chatper, I will introduce you how to set IP&DNS with bat

the follow step:

 

@echo off
rem eth
set eth="本地连接"
rem ip
set ip=192.168.0.153
rem gw
set gw=192.168.0.1
rem netmasks
set netmasks=255.255.255.0

echo 正在将本机IP更改到: %ip%
rem
netsh interface ip set address %eth% static %ip% %netmasks% %gw% 1
echo.........................
echo 检查当前本机IP:
ipconfig
echo.........................
echo 成功将本机IP更改为%ip%!
echo.........................
echo 修改DNS
rem dns1
set dns1=210.12.168.12
rem dns2
set dns2=202.98.96.68

echo 正在将本机DNS更改为:%dns1%和%dns2%
netsh interface ip set dns %eth% static %dns1%
netsh interface ip add dns %eth% %dns2%
echo 成功更改DNS
pause
close

 

 

copy this to a text file ,and then rename the file to network.bat,after that ,you can double click the file to run it 

分享到:
评论

相关推荐

    批处理修改IP和DNS地址

    例如,`netsh interface ip set address "接口名" static IP 地址 子网掩码 默认网关`将设置静态IP地址。 2. 更改DNS服务器设置,可以使用`netsh interface ip add dns "接口名" DNS服务器地址 index=1`命令添加首选...

    win7可用快速设置IP、DNS

    netsh interface ip set dns "本地连接" static 8.8.8.8 netsh interface ip add dns "本地连接" 8.8.4.4 index=2 ``` 上述脚本中,"本地连接"应替换为实际的网络接口名称,192.168.1.100是IP地址,255.255.255.0是...

    dos 批处理 改 ip dns 备用dns

    6. **保存设置**:最后,使用`netsh interface ip set dns "接口名" dhcp`或`netsh interface ip set dns "接口名" static`来保存设置,具体取决于是否需要保留静态DNS配置或恢复到DHCP自动获取。 批处理文件`ip1....

    一键ip设置dns设置批处理

    * netsh interface ip set dns:设置DNS服务器 知识点六:批处理逻辑 该脚本使用了批处理逻辑来控制脚本的执行流程。例如: * 使用if语句来判断用户的选择 * 使用goto语句来跳转到不同的执行路径 * 使用...

    用bat批处理配置网卡IP地址和DNS

    1:指令名 SetIP或者SetDNS 2:网卡MAC地址 如果要设为自动获取,后面就不需要参数了 如果是设置静态IP需要再带3个参数: IP地址 子网掩码 网关(可以为空) 设置DNS: DNS1 DNS2(可选) 如果无法运行,请安装.net4.0...

    IPset IP设置工具

    **IPset:便捷的IP配置工具** 在信息技术领域,网络配置是日常操作中不可或缺的一部分,尤其是在Windows XP系统中。IPset是一款专为XP用户设计的简单易用的IP设置工具,它极大地简化了手动配置IP地址的过程,避免了...

    IP dns修改工具 应用ip DNS快速更改

    Func _setip() ;导入IP配置 If Not FileExists($dir) Then MsgBox(16, "错误", "没有找到配置文件" & @CRLF & $dir, 3) Exit EndIf $colItems = "" $objWMIService = ObjGet("winmgmts:\\.\root\CIMV2") Dim ...

    setip-mac-v1.00.11

    为了确保K2200能在网络环境中正常工作,需要通过SetIP软件来配置它的网络参数,这包括但不限于静态IP地址、子网掩码、默认网关以及DNS服务器。静态IP地址通常在打印机不经常变动位置或需要固定地址进行远程访问时...

    CMD配置IP、DNS

    netsh interface ip set dns [name=]<接口名称> [source=]dhcp | static [addr=]<DNS服务器地址> [register=]none | primary | both ``` **参数解释:** - `name=`:指定网络接口的名称。 - `source=`:指定DNS...

    修改DNS与IP的脚本

    netsh interface ip set dns name="本地连接" source=static addr=8.8.8.8 ``` 该命令将本地连接的首选DNS服务器设置为8.8.8.8。 **注意**:如果需要添加多个DNS服务器,可以使用`add dns`命令,例如: ```bash ...

    XP/2K系统下自动修改IP、DNS设置.bat

    4. `netsh interface ip set dns name="接口名" static DNS_ADDRESS`:设置静态DNS服务器地址。 请注意,使用此类批处理文件时,用户需要确保输入的IP地址、子网掩码、默认网关和DNS服务器地址正确无误,否则可能...

    用bat文件自动修改IP和DNS(含固定和动态两种设置方式)

    netsh interface ip set dns "接口名称" static 首选DNS备用DNS ``` 这里,“接口名称”通常是你网络适配器的名称,例如“以太网”;“IP地址”,“子网掩码”和“默认网关”应替换为你的网络的具体值;“首选...

    快速更改IP地址及DNS地址

    而`netsh interface ip set dns`则是用来设定DNS服务器,同样支持DHCP和静态配置,可以设定首选和备用DNS服务器的IP地址。 当需要手动更改IP地址和DNS时,可以通过以下步骤操作: 1. 打开命令提示符(CMD)。 2. ...

    windows命令行IP,DNS配置.txt

    netsh interface ip set dns name="以太网" source=static addr=119.29.29.29 ``` 或者添加多个DNS服务器: ```cmd netsh interface ip add dns "以太网" 114.114.114.114 index=2 ``` 这里,`index=2`表示这是第二...

    自动更改IP地址,网关,DNS的批处理命令

    批处理命令是一种高效的方法,能够帮助用户自动化执行一系列操作,包括自动更改计算机的IP地址、网关和DNS设置。本文将详细讲解如何创建并使用批处理脚本来实现这一功能。 首先,我们需要了解网络配置的基本元素: ...

    更改DNS的IP地址

    4. 保存设置:使用`netsh interface ip set dns "接口名" dhcp`命令关闭DHCP服务,确保DNS设置不会被自动覆盖,或者用`netsh interface ip add dns "接口名" 新DNS地址 index=2`添加备用DNS。 5. 重启网络服务:使用...

    AutosetIP.zip

    在这个案例中,“auto_set_IP&DNS&Proxy.txt”很可能就是一个批处理文件,包含了设置IP、DNS和代理的命令序列。用户只需运行这个批处理文件,就可以快速地切换网络配置。 描述中提到的“设置IP&DNS&Proxy”涉及了三...

    自动设置IP地址和DNS服务器

    在该文件中,可能会包含`ipconfig`命令来获取或释放IP地址,`netsh`命令来设置静态IP地址,以及`nslookup`或`setdns`命令来设置DNS服务器。 例如,批处理文件可能包括以下内容: ```batch @echo off ipconfig /...

    AutoSetIP.zip

    为了解决这个问题,用户编写了一个名为“auto_set_IP&DNS&Proxy.bat”的批处理文件。批处理是Windows操作系统中的一种简单脚本语言,通过它可以组合多个命令并一次性执行,大大减少了重复劳动。 标签“批处理设置IP...

    ios app的dns to ip的使用

    iOS提供了`sc_network_set_cache_flush()`函数来刷新DNS缓存。 - **连接性能**:使用多个DNS服务器可以提高连接速度和可用性。当一个服务器无法响应时,系统会尝试下一个。 - **安全性**:DNS劫持和中间人攻击是...

Global site tag (gtag.js) - Google Analytics