A hostname is a human-readable nickname that is associated with one or more IP addresses.
The term varies depending on the context in which it is used. The term can refer to:
- The local name of a server, i.e.
- A domain name assigned to a host computer:
- This can refer to a fully-qualified domain name, like
wiki.gandi.netcan also be said to consist of a local hostname (
wiki) concatenated with a dot with a domain name (
- A nameserver in DNS.
A domain name can be a hostname as long as it has an IP address assigned to it (and meets restrictions on valid host names).
Inversely, a hostname can also be a domain name, provided it is properly organized into the domain name system.
Choosing a good hostname
When you create your server on Gandi's website, you are asked to enter a “host name” and password at the end of the process before payment. This “host name” is thus the name of your Gandi server.
Guidelines and suggestions on choosing good hostnames are imparted in RFC 1178, Choosing a Name for Your Computer:
- Use relatively rare words or names so as to avoid ambiguity
- Use a theme (but don't pick something limited or you might run out of names)
- Don't use a name associated with a project or function, since you are likely to use the machine for different projects (and changing a hostname is generally not a fun activity, though you can of course always delete a virtual server and create a new one)
- Avoid domain-like names (unless you're naming a virtual host)
Here are some examples of good hostnames:
You probably want to avoid hostnames like this:
- Your own name
mydomain.tld(unless you're naming a virtual host)
hostnamecommand displays the name of the current host machine, and can also be used to change or set the hostname. (Run
hostname -sto get just the hostname without the domain information.)