Updated: 10/07/2019 by Computer Hope
Desktop computer with a name tag on the screen.

Also called a computer name, nodename, or sitename, a hostname is the name of a computer or device (host) on a network.

Hostname examples

Below is an example of a hostname that is assigned to a computer connecting to the Internet using Comcast.

In this example, the hostname has the IP address (, "CO" for Colorado, and, 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 "" is connecting to the "bart" computer. The IP address of the "bart" computer is obtained by looking up the hostname "" in the host's file or DNS resolver.


When referring to an Internet web page (e.g., 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.

  1. A hostname is a single word with no spaces.
  2. A hostname may only have letters, numbers, periods, or a hyphen.
  3. A hostname has a maximum length of 253 characters.
  4. A DNS (Domain Name System) name may be appended to a hostname.
  5. The hostname cannot have an underscore. However, an appended DNS contained in the hostname may have an underscore.
  6. 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.
  7. 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.

DNS, Domain name, Host computer, Localhost, Network terms, rDNS