Hostname

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. squawky
  • A domain name assigned to a host computer:
    • This can refer to a fully-qualified domain name, like wiki.gandi.net, but wiki.gandi.net can also be said to consist of a local hostname (wiki) concatenated with a dot with a domain name (gandi.net).
  • A subdomain or domain name assigned to a Virtual host
  • 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:

  • galileo, einstein, curie, tesla
  • lark, falcon, raven, penguin, crow
  • homer, marge, bart, maggie, lisa, selma
  • gracehopper, adalovelace, sallyride

You probably want to avoid hostnames like this:

  • Your own name
  • mydomain.tld (unless you're naming a virtual host)
  • blog

On Unix systems, the hostname command displays the name of the current host machine, and can also be used to change or set the hostname. (Run hostname -s to get just the hostname without the domain information.)

See also

上一次變更: 2016/05/31 10:23 (外部編輯)