Alternatively referred to as a computer name, nodename, or sitename, a hostname is the name of the computer or device (host) you're currently logged into or visiting on a network.
Below is an example of a hostname that is assigned to a computer connecting to the Internet using Comcast.
As can be seen in the example above, this hostname has the IP address (188.8.131.52), "CO" for Colorado, and comcast.net, which is the ISP hosting the customer. This type of hostname would be stored in a Domain Name System to help with mapping the hostname to an address.
Local network hostname example
Another example would be a local network called "hope" with two computers on that network called "bart" and "homer." On this network, the "bart" computer would have a hostname "bart.hope" and the "homer" computer would have the hostname "homer.hope."
Internet hostname examples
On the Internet, a hostname is a domain name assigned to a host computer. For example, if Computer Hope had two computers on its network named "bart" and "homer," the domain name "bart.computerhope.com" is connecting to the "bart" computer. The IP address of the "bart" computer is obtained by looking up the hostname "bart.computerhope.com" in the host's file or DNS resolver.
When referring to an Internet web page (e.g., computerhope.com) or Internet location, a hostname is more often referred to as a domain name. If the domain name includes a TLD (top-level domain), then the hostname is an FQDN (fully qualified domain name).
How to see a computer's hostname
There are many different ways to determine a computer's hostname. On a Microsoft Windows computer, you can open the command line and run the hostname, ipconfig /all, or net view commands.
In the Linux command line, you can run the hostname command to view and set the hostname on the computer.
Hostname rules and restrictions
Below are a few rules and restrictions that must be followed for a hostname to be valid.
- A hostname is a single word with no spaces.
- A hostname may only have letters, numbers, periods, or a hyphen.
- A hostname has a maximum length of 253 characters.
- A DNS (Domain Name System) name may be appended to a hostname.
- The hostname cannot have an underscore. However, an appended DNS contained in the hostname may have an underscore.
- The early hostname specification in RFC 952 required that a hostname not begin with a number or hyphen character. However, this restriction was later changed in RFC 1123.
- Further recommendations on naming a computer are also on RFC 1178.
A hostname can have uppercase or lowercase characters. However, some tools and systems ignore case and consider everything lowercase. We recommend always using lowercase characters in hostnames to prevent any possible problems or confusion.
Should I use "host name" or "hostname" in my writing?
When referring to a computer on a network, "hostname" should be written as one word with no space unless referencing a product that uses the two-word form.
The Microsoft ipconfig, systeminfo, and other command line commands use "Host name" in the output.