- Changing the hostname on Windows 10
- Как изменить Hostname (имя компьютера)
- Просмотр текущего Hostname
- Как изменить Hostname
- Способ 1. Используем команду hostnamectl
- Способ 2. Редактируем файлы /etc/hostname и /etc/hosts
- Проверка результата
- Как временно изменить Hostname
- Change Hostname on Windows Server
- Using a Different System?
- Supported Versions
- Introduction
- Examples
- Change Hostname in PowerShell
- Change Hostname using GUI
- Update DNS
- About Hostnames
- How to change your computer’s name in Windows 10
- Change windows hostname from command line [closed]
- 8 Answers 8
Changing the hostname on Windows 10
Is there a problem if I change the Hostname on a windows 10 pro laptop. I have no software that depend on the current hostname.
Thank you for posting in Microsoft Community.
Computers on a network need unique names so they can identify and communicate with each other. Most computers come with default names, but you can usually change them. It’s best to keep computer names short (fifteen characters or less) and easily recognizable.
We recommend that you use only Internet-standard characters in the computer name. The standard characters are the numbers 0 through 9, uppercase and lowercase letters from A through Z, and the hyphen (-) character. Computer names can’t consist entirely of numbers, nor can they contain spaces. The name also can’t contain special characters, such as the following:
Note
Some Internet service providers (ISPs) require you to use a specific computer name so they can identify your computer and validate your account. If your ISP requires a specific computer name, don’t change the name they give you.
To change your computer name follow the Steps below.
1. Type Rename your PC or Join a Domain.
2. Click or tap on Rename PC and follow the onscreen instructions.
If your computer is part of a domain, you will be prompted to provide the name and password of an account that has permission to rename the computer in the domain.
Hope this information is helpful. Please do let us know if you need further assistance, we’ll be glad to assist you.
Как изменить Hostname (имя компьютера)
Hostname (имя компьютера, имя хоста) задается во время установки системы Linux. Hostname определяет название компьютера и используется преимущественно для идентификации компьютера в сети. Нельзя назначать два одинаковых Hostname для компьютеров в одной сети.
Просмотр текущего Hostname
Чтобы показать текущий Hostname можно использовать команду hostname без параметров:
Также Hostname можно отобразить командой hostnamectl :
Как изменить Hostname
Рассмотрим, как изменить Hostname двумя разными способами.
Способ 1. Используем команду hostnamectl
Во многих systemd-based дистрибутивах (например, в Ubuntu Linux) есть утилита hostnamectl .
Воспользуемся командой hostnamectl , чтобы установить новое значение Hostname равным pingvinus . Используется аргумент set-hostname:
Способ 2. Редактируем файлы /etc/hostname и /etc/hosts
Еще один способ изменения Hostname — это ручное редактирование файла /etc/hostname и файла /etc/hosts .
Сначала выполните команду (вместо pingvinus укажите свое значение):
Отредактируем файл /etc/hostname для редактирования в редакторе nano, выполняем команду:
Измените текущее значение в файле на новое. Сохраните изменения и закройте файл. Это можно сделать, нажав Ctrl+C , затем Y и Enter .
Hostname прописывается также в файле /etc/hosts , поэтому нужно изменить его значение в этом файле. Откроем файл:
Найдите строку вида « 127.0.0.1 ваш_hostname » и впишите новое имя хоста. Сохраните изменения и закройте файл.
Проверка результата
Чтобы проверить, изменилось ли значение Hostname, откройте новое окно терминала и введите команду:
Как временно изменить Hostname
Чтобы изменить Hostname в текущей работающей системе Linux, но до первой перезагрузки, можно использовать просто команду hostname , указав ей новое значение имени хоста:
Change Hostname on Windows Server
Using a Different System?
Supported Versions
This guide applies to:
- Windows Server 2019
- Windows Server 2016
- Windows Server 2012 R2
Introduction
When creating a new Vultr VPS, you can set the Server Hostname before deployment. If you skip this step or decide to rename your server later, you’ll discover that changing the server hostname from the Customer Portal also performs a fresh reinstall of the entire server.
Follow this guide if you need to change the server hostname without reinstalling.
Examples
This guide uses OLDDOG for the old hostname and NEWTRICKS for the new hostname.
Change Hostname in PowerShell
Open an elevated PowerShell. If you are in standard PowerShell, elevate your access as shown:
Check the hostname with $env:computername .
Change the hostname to NEWTRICKS. Using the -Restart parameter will also immediately restart the server. Full documentation on the Rename-Computer cmdlet is available at Microsoft.
Verify the hostname has changed with $env:computername .
Change Hostname using GUI
- Log in to the server via RDP.
- Navigate to the «This PC» screen and click «System properties».
- Click «Change settings» next to the current computer name.
- Click the «Change» button.
- Enter a new computer name and confirm by clicking «OK».
- Restart the server.
Update DNS
This procedure does not change your DNS name, and you’ll need to perform those steps at your domain registrar.
About Hostnames
A hostname is what identifies a server. Most Windows Server users name their servers with the hostname consisting of two parts: role.domain . The role part is the role installed on the server, followed by the number. For example, dc01 if this is the first server that acts as a DC in this particular network. Then, Windows makes this an FQDN by putting the Active Directory domain as the domain part. For example, if this is the third web server in this network, and the domain is example.com , the hostname would be:
Note that changing the hostname on Windows Server may conflict with some installed roles. It is a good idea to change the hostname before installing roles on the server. If you decide to change the hostname on a Windows Server with roles installed, make a snapshot first. Therefore, if something breaks, you will be able to restore your server from that snapshot.
How to change your computer’s name in Windows 10
Want to make your PC more recognizable on your network? Follow these steps to rename it.
There are plenty of reasons to change your computer’s name — especially if you bought it directly from a manufacturer and it’s named something generic like «windows-user-pc» or «TUF000445811EE». If you want to connect computers through a homegroup, or just be able to recognize which computers are on your network, changing your computer’s name to something more descriptive is definitely helpful.
Or maybe you just want to name your computer something cool — add a personal touch. I name all my computers after figures from Greek mythology. I also name my cars.
Before Windows 10, changing your computer’s name was complicated. Well, not so much complicated as hidden inside the Control Panel in the System Properties windows. While you can still change your computer’s name in System Properties (we’ll show you how), Windows 10 has made it much simpler by putting it in the new Settings menu.
Here’s the easy way to change your computer’s name:
1. Open Settings and go to System > About.
Sarah Jacobsson Purewal/CNET
2. In the About menu, you should see the name of your computer next to PC name and a button that says Rename PC. Click this button.
Sarah Jacobsson Purewal/CNET
3. Type the new name for your computer. You can use letters, numbers and hyphens — no spaces. Then click Next.
Sarah Jacobsson Purewal/CNET
4. A window will pop up asking if you want to restart your computer now or later. If you want to change to the new name immediately, click Restart now to restart your computer. If you don’t want to restart your computer right this second, click Restart later. Your computer’s name will be updated the next time you restart it.
If you’d rather change your computer’s name in the Control Panel, or if you’re running an older version of Windows, here’s how to do that:
1. Right-click on the Start button and click Control Panel.
Sarah Jacobsson Purewal/CNET
2. Navigate to System and either click Advanced system settings in the left-hand menu or click Change settings under Computer name, domain, and workgroup settings. This will open the System Properties window.
Sarah Jacobsson Purewal/CNET
3. In the System Properties window, click the Computer Name tab. You’ll see the message, «To rename this computer, click Change.» Click Change.
Sarah Jacobsson Purewal/CNET
4. Type the new name for your computer and click OK. A window will pop up telling you that you must restart your computer before the changes can be applied. Click OK. This will not restart your computer.
Sarah Jacobsson Purewal/CNET
5. A new window will pop up asking if you would like to restart your computer now or later. Click Restart Now to restart your computer immediately. If you’re not ready to restart, click Restart Later to do it later, at your leisure.
Change windows hostname from command line [closed]
Want to improve this question? Update the question so it’s on-topic for Stack Overflow.
Closed 2 years ago .
Is it possible to change the hostname in Windows 2003 from the command line with out-of-the-box tools?
8 Answers 8
The netdom.exe command line program can be used. This is available from the Windows XP Support Tools or Server 2003 Support Tools (both on the installation CD).
The previously mentioned wmic command is the way to go, as it is installed by default in recent versions of Windows.
Here is my small improvement to generalize it, by retrieving the current name from the environment:
NOTE: The command must be given in one line, but I’ve broken it into two to make scrolling unnecessary. As @rbeede mentions you’ll have to reboot to complete the update.
powershell (windows 2008/2012):
after that, you need to reboot your computer.
I don’t know of a command to do this, but you could do it in VBScript or something similar. Somthing like:
Here’s another way of doing it with a WHS script:
Use below command to change computer hostname remotely , Require system reboot after change..
psexec.exe -h -e \\\IPADDRESS -u USERNAME -p PASSWORD netdom renamecomputer CurrentComputerName /newname:NewComputerName /force
Why be easy when it can be complicated? Why use third-party applications like netdom.exe when correct interogations is the way? Try 2 interogations:
wmic computersystem where caption=’%computername%’ get caption, UserName, Domain /format:value
wmic computersystem where «caption like ‘%%%computername%%%'» get caption, UserName, Domain /format:value
or in a batch file use loop
for /f «tokens=2 delims==» %%i in (‘wmic computersystem where «Caption like ‘%%%currentname%%%'» get UserName /format:value’) do (echo. UserName- %%i)