命令行格式
命令行用法
XbUpdateHosts add
将提供的主机名映射添加或替换到主机上。用法
xbupdatehosts add <target host name> <IP address> 主机名可以指定为 @auto,以使用开发 PC 的主机名和完全限定域名。 IP 地址参数可以指定为 @auto,以表示使用连接到主机的 IP 地址作为值。如果开发 PC 已连接到多个网络,则这很有用。XbUpdateHosts remove
从主机中删除提供的主机名映射。用法
xbupdatehosts remove <target host name> 主机名可以指定为 @auto,以同时删除开发 PC 的主机名和完全限定域名。XbUpdateHosts list
列出存储在主机上的所有主机名映射。用法
xbupdatehosts list 此命令输出主机上主机名映射的列表。XbUpdateHosts backup
创建存储在主机上的所有主机名映射的备份。用法
xbupdatehosts backup <backup file name>XbUpdateHosts restore
从文件中将所有主机名映射还原到主机上。用法
xbupdatehosts restore <backup file name>命令行示例
XbUpdateHosts 的常见命令行示例如下。- 根据连接到主机的地址添加当前开发 PC 的映射:xbupdatehosts add @auto @auto
- 根据连接到主机的地址添加另一台主机的映射:xbupdatehosts add other.host.name @auto
- 删除映射:xbupdatehosts remove other.host.name
- 备份映射:xbupdatehosts backup .\hostsbackup.txt
- 还原映射:xbupdatehosts restore .\hostsbackup.txt
