如何在 windows 服务器 2012 (AWS EC2) 中更改和验证主机名
How to change & verify hostname in windows server 2012 (AWS EC2)
我正在使用 Windows Server 2012-R2 (amazon ec2) 机器。
我想更改并验证其中的主机名。我在网上查了一下,发现了主机名命令。但是当我 运行 hostname 或 hostname -i 命令时,出现以下错误..
sethostname: Use the Network Control Panel Applet to set hostname.
hostname -s is not supported.
我进一步搜索了这个问题,显然这个命令在 windows 2012-r2 服务器上不可用。是否有任何替代或解决方法命令可以为我完成这项工作?
在 windows 上,计算机名称通常也称为主机名。然而,这会造成一些混乱。有些人使用术语主机名来指代只能在 DNS 服务器上设置的域名的最左边部分。然而,主机名的另一个含义只是分配给计算机网络上的机器的任意标签,并且可以在特定机器上直接更改。
在 windows 2012 上有几种从命令行更改计算机名称的方法:
方法一、打开cmd,输入:
SCONFIG and you will get selection menu where #2 says Computer Name:
方法 2. 从 cmd 类型:
netdom renamecomputer %computername% /newname:<NewName> /reboot:0
方法 3. 从 PowerShell 控制台:
netdom renamecomputer $env:computername /newname:<NewName> /reboot:0
要验证名称表单cmd类型:
nbtstat -A xxx.xxx.xxx.xxx (where x is the ip address)
另一种验证名称形式的方法 cmd 只需键入 "hostname" 不带任何参数:
hostname
我正在使用 Windows Server 2012-R2 (amazon ec2) 机器。
我想更改并验证其中的主机名。我在网上查了一下,发现了主机名命令。但是当我 运行 hostname 或 hostname -i 命令时,出现以下错误..
sethostname: Use the Network Control Panel Applet to set hostname.
hostname -s is not supported.
我进一步搜索了这个问题,显然这个命令在 windows 2012-r2 服务器上不可用。是否有任何替代或解决方法命令可以为我完成这项工作?
在 windows 上,计算机名称通常也称为主机名。然而,这会造成一些混乱。有些人使用术语主机名来指代只能在 DNS 服务器上设置的域名的最左边部分。然而,主机名的另一个含义只是分配给计算机网络上的机器的任意标签,并且可以在特定机器上直接更改。
在 windows 2012 上有几种从命令行更改计算机名称的方法:
方法一、打开cmd,输入:
SCONFIG and you will get selection menu where #2 says Computer Name:
方法 2. 从 cmd 类型:
netdom renamecomputer %computername% /newname:<NewName> /reboot:0
方法 3. 从 PowerShell 控制台:
netdom renamecomputer $env:computername /newname:<NewName> /reboot:0
要验证名称表单cmd类型:
nbtstat -A xxx.xxx.xxx.xxx (where x is the ip address)
另一种验证名称形式的方法 cmd 只需键入 "hostname" 不带任何参数:
hostname