Network - Hostname (System's host name)

About

A hostname is a name for a host (ie for the operating system).

The host name or computer name:

  • is a logical name for the host itself
  • is set in the operating system (used to initialize the OS kernel hostname)
  • is unique for the host (but it may have several logical name called IP name)

The operating system knows its own host under its host name.

Hostname vs IP Name

A hostname is not an IP name because a host:

If the relevant host only has one network adapter, the host name and the IP name are normally identical. In this case, there is a unique relationship between the logical host name and the IP name. This means that this host can be addressed by other computers using its host name.

Virtual

A Hostname may be virtual meaning that a service hosted on a system with the name foo can answer a request for the hostname bar.

This is used for instance to host several web server. See HTTP - Virtual Host (or Vanity hostnames)

Value

Long

The value of the hostname is a full qualified format.

hostname
myname.example.com

Short

But you can query also the relative format.

hostname -s
myname

Type

Static

The static hostname is the hostname that is defined on the host itself (generally in a file).

Linux: it is configured in the /etc/hostname file.

If the static hostname is not set, the transient hostname is the default one.

Transient

The Transient hostname represents the name that is set by network configuration such as:

  • HostFile
  • DHCP
  • or DNS

after a system boot.

If the Transient hostname is not set, the system uses the Static hostname.

Management

Query

You can query the hostname under UNIX or Windows by using the command hostname. Linux - Hostname (Kernel, Static)

Default

If a static hostname is not set, the default hostname is the one defined by the network configuration and is also known as transient hostname

Set

The hostname that is set is called the static hostname.

If not set, the hostname of the network configuration is taken, see default

The hostname should be set with a full qualified format.

To set it on linux, see Linux - Hostname (Kernel, Static)

Documentation / Reference


Powered by ComboStrap