hostname

Show or set the system's hostname

hostname prints the current hostname. hostname -f shows the fully qualified domain name. A wrong hostname causes auth failures in distributed systems.

Example

$ hostname
$ hostname -f
prod-api-01
prod-api-01.internal.example.com
Tip: Type it yourself in the terminal below - reading is not the same as doing.