Change Hostname on OpenBSD
source link: https://www.vultr.com/docs/change-hostname-on-openbsd-best-practices
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Using a Different System?
- Change Hostname on Ubuntu
- Change Hostname on Debian
- Change Hostname on Fedora
- Change Hostname on CentOS
- Change Hostname on FreeBSD
- Change Hostname on Windows Server
- Change Hostname on Fedora CoreOS
- Change Hostname on CoreOS
- Change Hostname on Arch Linux
- Change Hostname on VzLinux
- Change Hostname on Rocky Linux
- Change Hostname on AlmaLinux
Supported Versions
This guide applies to OpenBSD 6 and earlier.
Introduction
When creating a new Vultr VPS, you can set the Server Hostname before deployment. If you skip this step or decide to rename your server later, you'll discover that changing the server hostname from the Customer Portal also performs a fresh reinstall of the entire server.
Follow this guide if you need to change the server hostname without reinstalling.
Examples
This guide uses olddog for the old hostname and newtricks for the new hostname.
1. Check the Current Hostname
Check the hostname with hostname
.
$ hostname
olddog
2. Change Hostname
Change the hostname to newtricks using a text editor:
- Change all occurrences of the old server name to the new server name in /etc/myname.
- Change all occurrences of the old server name to the new server name in /etc/hosts.
3. Confirm the Change
- Reboot the server.
Test your change with
hostname
.$ hostname newtricks
Update DNS
Your server hostname is changed and ready to use. This procedure does not change your DNS name, and you'll need to perform those steps at your domain registrar.
Want to contribute?
You could earn up to $600 by adding new articles
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK