Server Operations · about 1 min · 4 steps
Set the hostname
Renames the server, and updates /etc/hosts so sudo and other tools still resolve its name.
Runs on
- Debian / Ubuntu: supported
- RHEL / Fedora: supported
- Alpine: supported
What it changes on your server
- Sets the hostname now and in /etc/hostname.
- Points the name at 127.0.1.1 in /etc/hosts, replacing the previous 127.0.1.1 line. The old file is kept with the run for 7 days.
- On cloud servers, tells cloud-init to keep the name after reboots.
What Shellbay asks you
What should the server be called?
Use letters, digits and hyphens, e.g. web1, or a full name such as web1.example.com. It appears in your prompt and logs; it doesn't change DNS.
- Hostname
- Text, up to 253 characters
Example:
web1
Steps
- Check the name
- Update /etc/hosts
- Set the hostname
- Check the new name
Shellbay checks the server before the first step, and stops at the first step that fails.
When it's done
- The server is now ‹hostname›. Your prompt shows it the next time you connect.