如何更改和验证Windows Server 2012(AWS EC2)中的主机名 [英] How to change & verify hostname in windows server 2012 (AWS EC2)

查看:354
本文介绍了如何更改和验证Windows Server 2012(AWS EC2)中的主机名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Windows Server 2012-R2(amazon ec2)计算机.

I am using Windows Server 2012-R2 (amazon ec2) machine.

,我想更改并验证其中的主机名.我在网上检查并找到主机名命令.但是当我运行主机名或主机名-i命令时,出现以下错误.

and I want to change and verify hostname in it. I checked on net and found hostname command. But when I run hostname or hostname -i command I get following error..

sethostname:使用网络控制面板小程序设置主机名.

sethostname: Use the Network Control Panel Applet to set hostname.

不支持主机名-s.

我进一步搜索了这个问题,显然该命令在Windows 2012-r2服务器上不可用.有没有其他替代方法或解决方法命令可以为我完成这项工作?

I further googled this problem and apparently this command is not usable on windows 2012-r2 servers. Is there any alternative or workaround command that can do the job for me??

推荐答案

在Windows上,计算机名称通常也称为主机名.但是,这会造成一些混乱.有些人使用主机名"一词来指代域名的最左侧,该域名只能在DNS服务器上设置.但是,主机名的另一种含义就是为计算机网络上的计算机分配一个任意标签,并且可以在特定计算机上直接更改该标签.

On windows the computer name is also often referred to as hostname. However this creates some confusion. Some people use the term hostname to refer to the leftmost part of domain name which can only be set on a DNS server. However another meaning of a hostname is just an arbitrary label assigned to a machine on a computer network, and this can be directly changed on the specific machine.

有几种方法可以从Windows 2012的命令行中更改计算机名称:

There are several ways to change the computer name from the command line on windows 2012:

方法1.打开cmd并输入:

Method 1. Open cmd and type:

    SCONFIG and you will get selection menu where #2 says Computer Name:

方法2.从cmd输入:

Method 2. From cmd type:

    netdom renamecomputer %computername% /newname:<NewName> /reboot:0

方法3.从PowerShell控制台:

Method 3. From the PowerShell console:

    netdom renamecomputer $env:computername /newname:<NewName> /reboot:0

要验证名称形式的cmd类型,请执行以下操作:

To verify the name form cmd type:

    nbtstat -A xxx.xxx.xxx.xxx (where x is the ip address)

另一种验证cmd名称形式的方法是,不带任何参数地键入"hostname":

Another way to verify the name form cmd just type "hostname" without any parameters:

    hostname

这篇关于如何更改和验证Windows Server 2012(AWS EC2)中的主机名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆