# Hostname

> The human-readable name a device uses on a network.

- Level: Intermediate
- Topics: Networks
- URL: https://tidbit.legios.com.ar/hostname/
- In Spanish: [Hostname](https://tidbit.legios.com.ar/es/hostname/)

Every device on a network has an IP address, but numbers are hard to remember. A **hostname** is the name a device goes by instead: `laptop-ana`, `printer-2`, `db01`. You choose it when you set up a computer, and you can see it on your own machine by typing `hostname` in a terminal.

On the internet, hostnames sit inside domain names. In `mail.example.com`, `mail` is the host and `example.com` is the domain it belongs to; written out in full, the whole thing is called a **fully qualified domain name** (FQDN). DNS translates that name into an IP address, so a company can move its mail server to a new machine and only update DNS, while everybody keeps typing the same name.

Hostnames have simple rules: letters, digits and hyphens, with each part up to 63 characters. They show up in many places you might not expect: in your router's list of connected devices, in log files, in error messages, and in the certificates that make HTTPS work, which are issued for specific hostnames. Picking clear, consistent names is a small habit that makes a network much easier to manage.

## An analogy

The name on an apartment's doorbell versus its street address. The address is how the mail actually gets there; the name is what people remember and look up.

## Keep in mind

- A readable name for a device, alongside its IP address.
- In mail.example.com, mail is the host and example.com the domain.
- DNS turns hostnames into IP addresses.
- Allowed characters: letters, digits and hyphens; up to 63 per part.

## Go deeper

- [Hostname on Wikipedia](https://en.wikipedia.org/wiki/Hostname)
- [RFC 1123: Requirements for Internet Hosts (RFC Editor)](https://www.rfc-editor.org/info/rfc1123/)

## Related terms

- [IP address](https://tidbit.legios.com.ar/ip-address/): The number that identifies a device on a network, like a postal address.
- [Command line](https://tidbit.legios.com.ar/command-line/): Controlling a computer by typing text commands instead of clicking icons.
- [Internet](https://tidbit.legios.com.ar/internet/): A worldwide network of networks that lets any connected device reach any other.
- [Domain name](https://tidbit.legios.com.ar/domain-name/): The readable name of a website, like wikipedia.org, that stands in for a numeric address.
- [DNS](https://tidbit.legios.com.ar/dns/): The internet's phone book: it turns names like wikipedia.org into IP addresses.
- [Email protocols](https://tidbit.legios.com.ar/email-protocols/): The shared rules, SMTP, IMAP and POP3, that carry an email from one inbox to another.
- [Router](https://tidbit.legios.com.ar/router/): The box that connects your devices to each other and to the internet.
- [TLS certificate](https://tidbit.legios.com.ar/tls-certificate/): The ID card a website shows your browser to prove it is who it claims to be.
