Show and change hostname
Show
To show your hostname, you can conveniently type hostname
into the terminal:
Example output:
Desktop.domain.local
To omit the domain information from the output, type hostname -s
Desktop
Edit
Hostname information is located in /etc/myname
and it's read during the startup. Edit the content of the file to change hostname.
$ doas nvim /etc/myname
This will however propagate on the next reboot, to change the hostname immediately, type:
$ doas hostname new_hostname
$ hostname
new_hostname