Open In App

Introduction to Host Names

Last Updated : 06 Oct, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

A hostname is essentially a shorthand for a computer or other device attached to a computer network with a unique IP address, which is the physical address of the web server. Computers require names to distinguish one machine from another, just as a name is used to identify a person, a place, or a thing.

Working of Host Name: 

Users typically do not deal with IP addresses but deal with host names. These names are arranged in a hierarchical structure. The naming hierarchy is based on the concept of naming domains. Each domain covers some subset of the entire set of names. At the top level, there are domains corresponding to educational institutions (.edu), commercial entities (.com), public organization (.org), government entities (.gov), etc. There are also top-level domains for countries. Below is shown such a hierarchy.

Each organization gets a name at the second level in the name hierarchy. For example, Geeksforgeeks has geeksforgeeks.org. It is possible to add additional naming levels within an organization, and this is typically done to identify sub-organizations or departments within the larger organization.

Finally, each host (end-system) has a unique name within its department or sub-organization. The complete name of a host includes this name as well as the names of all sub-organization units, the organization name, and the top-level domain. For example, in our Geeksforgeeks organization, we have write.geeksforgeeks.org and contribute.geeksforgeeks.org.

 

Guidelines/Rules for Host Name:

Each element of the hostname must be from 1 to 63 characters long and the entire hostname, including the dots or period(.), can be at most 253 characters long. Valid characters for hostnames are 

  • letters from a to z
  • the digits from 0 to 9
  • the hyphen (-)
  • can’t start with a hyphen.

Host Name and Domain Name:

A hostname is a domain name given to the host. It’s a human-readable nickname that is associated with a corresponding MAC or physical address which is unique for every device. Although the terms “hostname” and “domain name” are frequently used interchangeably, they have a small difference in them. All hostnames are domain names, but not all domain names are hostnames. Domain names make IP addresses more human-friendly.

Host Name Domain Name
A hostname is the name of the device or computer connected to the network.  A domain name is the address of the website to access the website by the user. 
This name or label is used to distinguish between two devices on the network. It is the alternative to the IP addresses which are quite human friendly instead of IP addresses.
All hostnames are the domain name. Not all domain names are hostname.
The hostname must contain characters ‘a’ through ‘z’ and for digits, it should be ‘0’ through ‘9’ and it can contain the hyphen (-). Domain names are composed of a series of labels, each separated by a dot.

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads