I need to migrate my old database server (let say: intranet) to new server (intranet2). The software at the client was developed to be connected to server using hostname instead of IP address. I need to change the hostname of new server because I give it different hosname (of course it will causes a conflict if you have two machines with same name).
To change new server’s hostname from intranet2 to intranet, here are the steps:
- Login to Linux shell as root
- Run this command to change hostname
hostname yournewhostname
eg: hostname intranet (to change hostname to intranet) - Edit hostname file to make sure that the hostname is set correctly when the server reboot
Hostname file usually located at /etc/hostname
- Done
That’s all.
Leave a Comment