Change hostname and IP address of Linux server without rebooting server

You can change option in third line in /etc/hosts file on Linux server without rebooting;/etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.1 server.seimaxim.com seimaximYou can change all of the following options in /etc/sysconfig/network without reboot./etc/sysconfig/networkNETWORKING=yes HOSTNAME=server.seimaxim.com GATEWAY=192.168.0.1Similarly options in /etc/sysconfig/network-scripts/ifcfg-eth0 can also be changed./etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.0.1 NETMASK=255.255.255.0Hostname of server can be changed with;hostname server.seimaxim.comRestart network with;systemctl restart network

Leave a Reply

Your email address will not be published. Required fields are marked *