What Is A Hostname?

What Is A Hostname

Date First Published: 4th May 2022

Topic: Computer Networking

Subtopic: Network Identifiers

Article Type: Computer Terms & Definitions

Difficulty: Medium

Difficulty Level: 5/10

Learn more about what a hostname is in this article.

A hostname, originally known as a nodename, is a customisable name or label that is assigned to a device which identifies it on a network. This allows one device to be differentiated from another on a network. Hostnames consist of alphanumeric characters and are used in both LANs and WANs. There are two types of hostnames, which include local network hostnames and internet hostnames.

Local Network Hostname

A local network hostname identifies a device on a network. They are also translated. For example, if a hostname was called ‘My Hostname’, it would be translated to ‘my-hostname.local’. On Mac, hostnames can be customised by making changes to the name of the computer in the ‘System Preferences’ setting and the ‘Sharing’ section by clicking on ‘Edit’ and then typing the custom hostname. On Windows, hostnames can be customised by making changes to the name of the computer in Control Panel by going to ‘System’, and the ‘Computer Name’ section by clicking on ‘Change settings’ and then typing the custom hostname. Hostnames can be as long as 15 characters on Windows. Note that changing the hostname will require administrator access.

Internet Hostname

An internet hostname has the same meaning as a domain name, such as youtube.com. They consist of an SLD, such as ‘youtube’, a dot, and a TLD, such as ‘com’. Domain names with no prefixes, such as ‘www’ are still considered internet hostnames. Internet hostnames are used to help people visit websites quicker without having to remember numerical IP addresses, such as 123.123.123.123. The IP address is mapped to the hostname in a DNS record, called an A record or the local hosts file. Internet hostnames can be as short as 2 characters and as long as 63 characters.

Note: Info Icon

Internet hostnames are not case-sensitive. For example, COMPUTERHELP4ALL.COM or cOmPuTeRhElp4AlL.com would still point to computerhelp4all.com and successfully resolve from DNS or the local hosts file.

Disallowed Characters

Local network hostnames and internet hostnames cannot contain spaces or special characters. In other words, the only allowed characters in a hostname are letters, numbers, and hyphens (-). The characters (`~!@#$%^&*()=+_[]{}\|;:.’”,<>/?) are disallowed characters in a hostname. Internet hostnames can begin with numbers, such as ‘10example.com’, but cannot begin or end with hyphens, such as ‘-example.com’ or example-.com.

Disallowed Hostname Screenshot

As shown in the screenshot above, the hostname 'Desktop 01' was disallowed because it contained a space.


Feedback

  • Is there anything that you disagree with on this page?
  • Are there any spelling, grammatical, or punctuation errors on this page?
  • Are there any broken links or design errors on this page?

If so, it is important that you tell me as soon as possible on this page.