How to Change Hostname in Unix FreeBSD
We have interesting hostname for our all our servers. Some of it is using Football Team like Manchester, Liverpool, Chelsea, Arsenal. Part of it is striker name like Rooney, Ronaldo and etc. We also have like meganfox, milla, jessicaalba for those “hot” “steamy” servers. Occasionally if the football team is not perform well, we will change the hostname for the server to other football team, for example Manchester to Chelsea. Yea.. We are not loyal support, we only support the no. 1 team.
Joking aside, how to change server hostname in Unix FreeBSD? There are 2 ways to do it, one is the easy way another is the geeky way. Depend on yourself, if you want to show your elite skills, do it with the text editor, or make the change with Sysinstall.
Change Hostname in Unix FreeBSD with Sysinstall
- In command line, type: sysinstall
- Select Configure
- Select Networking
- Select Interfaces
- Select your Network Interface Card (em0 em1 fxp0)
- No IPV6 (Select yes if you are running on ipv6)
- No DHCP (Select yes if you are running on dhcp)
- host: should be your server name like chelsea
- domain: should be your own domain like takizo.com
- Select Ok
- Exit, Exit, Exit
- In command shell, type: hostname chelsea.takizo.com
This will update your new hostname in Unix FreeBSD box. But please take note you will have extra junk in /etc/rc.conf. So it’s recommend to change your hostname in Unix FreeBSD with following method.
Change Hostname in Unix FreeBSD in “Clean” Way
- In command shell, type: hostname chelsea.takizo.com
- Edit /etc/hosts with vi, change the existing hostname to your new hostname
- Edit /etc/rc.conf with vi, on the “hostname” variable change the existing hostname to your new hostname
This is the better approach in order to organize your /etc/rc.conf clean and clear.
Related posts:
- Change or Set User Password in FreeBSD If you notice, during FreeBSD installation, it doesn’t have a...
- How to Change User’s Shell Environment in FreeBSD In FreeBSD, user’s default shell environment is either sh or...
- How to Install FreeBSD 5.4 on Your Machine FreeBSD is an advanced operating system for x86 compatible (including...
- Setup Sendmail Smart Relay in FreeBSD It’s good that to route all your outgoing email to...
- Linux/Unix Search and Replace Text from Multiple Files In Linux/Unix, for newbie to do search text from multiple...
- Modify or Adjust File Date Time on Unix/Linux You have folders or files in your server last modified...
- Changing File’s Date and Time on Unix Systems Change Data and Time of a File At times, we...
- Disabled Sendmail Service on FreeBSD Disabled Sendmail Service on FreeBSD is slightly different compare to...
- Enable SSHD on FreeBSD I believe most system admin does remote access to the...
- Configure NTP Server on FreeBSD Configure a NTP time server on FreeBSD is fairly easy....