Ubuntu
Change hostname without a restart
- Last tested on Ubuntu 16.04 (2018-04-23)
- To permanently change the computer name
Edit/etc/hostname
and/etc/hosts
- Restart hostname service
$ systemctl restart systemd-logind.service
- Use hostnamectl with set-hostname flag.
$ hostnamectl set-hostname NEW_NAME_HERE
Version specific
- Ubuntu 22.04 LTS