Friday, 26 April 2013

Changing HOSTNAME & IP Address - Linux

CHAGING HOSTNAME IN LINUX

1) Make the entries in below files

#/etc/hosts
#/etc/sysconfig/network
#/etc/sysconfig/network-scripts/ifcfg-eth0 (depends on NIC name)
Then reboot.
or-

2) Use sysctl to change the hostname

Use:

#sysctl kernel.hostname

to read the current hostname, and sysctl kernel.hostname=NEW_HOSTNAME to change it.

CHAGING IP ADDRESS IN LINUX.

Take backup and change to new ip in "/etc/sysconfig/network-scripts/ifcfg-eth0" & "/etc/sysconfig/network"
#vi /etc/sysconfig/network-scripts/ifcfg-eth0

#vi /etc/sysconfig/network

And restart the interfaces...

#/etc/init.d/network restart

Try /sbin/setup or /usr/sbin/setupor edit /etc/network/interfaces

0 blogger-disqus:

Post a comment