What Is a Hostname?
A hostname is a unique label assigned to a device within a network, used to identify and distinguish it from other devices.
- On a home network, hostnames may look like FamilyPC, Guest-Desktop, or newlaptop.
- Hostnames ensure each connected device has a distinct identity, simplifying device management and communication.
DNS servers also rely on hostnames to convert human-readable names into IP addresses.
- This means you can access a site like example.com without needing to remember its numeric IP address.
Other terms for hostname include computer name, sitename, or nodename, and it may also be written as host name.
Examples of Hostnames
A hostname is the first part of a Fully Qualified Domain Name (FQDN) and helps direct internet traffic.
Examples include:
www.google.com
: hostname is wwwimages.google.com
: hostname is imageslearn.microsoft.com
: hostname is learnwww.microsoft.com
: hostname is www
The hostname appears before the domain name, which itself precedes the top-level domain like .com
.
How to Find a Hostname in Windows
The quickest way to find your computer’s hostname is by running the **hostname**
command in Command Prompt.
- This instantly returns your system’s current network identifier.
Other useful commands include:
**ipconfig /all**
: provides detailed network information, including the hostname.**net view**
: shows hostnames of all devices connected on the same network.
These commands also work in terminal windows on macOS and Linux.
How to Change a Hostname in Windows
You can view and change your hostname through System Properties in Windows.
- Access this by pressing Win + R, typing
control sysdm.cpl
, and pressing Enter. - The Full computer name listed in the dialog box is your current hostname.
From this screen, you can edit the hostname, often requiring administrator rights and a system restart to apply the changes.
More About Hostnames
Hostnames must follow specific rules to ensure they’re valid across all systems.
- They may only include letters, numbers, and hyphens; spaces are not allowed.
- Hostnames are case-insensitive but must follow consistent formatting.
In a URL, the www portion is technically a subdomain—just like learn in learn.microsoft.com
.
- For example,
images.google.com
uses images as the hostname to access a specific content section. - Typing www.lifewire.com instead of just lifewire.com can be necessary, depending on how the site is configured.
Most modern websites automatically handle whether or not you include the www, but not all do.
Hostnames and Dynamic IPs
For networks with a dynamic IP address, services like Dynamic DNS (DDNS) can assign a permanent hostname.
- Providers like No-IP link a changing IP to a static hostname, allowing consistent remote access.
- This setup is especially useful for home servers, security cameras, or gaming servers.
With DDNS, you can access your network using a memorable name even if the IP changes frequently.
FAQ
How do I find and change my hostname on Linux?
Open the terminal, type hostname
, and press Enter. To change it, run sudo hostname NEW_HOSTNAME
, replacing NEW_HOSTNAME
with your desired name.
What is the hostname for Gmail?
When using Gmail in email clients:
- Incoming hostnames:
imap.gmail.com
orpop.gmail.com
- Outgoing hostname:
smtp.gmail.com
What is a hostname in Minecraft?
In Minecraft, the server name is the hostname. Setting a custom hostname helps players connect without remembering long IP addresses.