How to
change IP and HOST-NAME on a Solaris 10
In Solaris 10, you must edit the /etc/hosts and the /etc/inet/ipnodes file (a symbolic link to
/etc/inet/hosts file) with VI editor to do necessary changers an entry for IP
address and/or hostname.
How to show the hostname of your system:
# hostname
NTU-HQ-EMS
#
How to show the IP details of your network interfaces:
# ifconfig -a
lo0:1:
flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232
index 1
inet 127.0.0.1 netmask ff000000
igb0:1:
flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 172.16.0.1 netmask ffffff00
broadcast 172.16.0.255
#
You can change Red (IP) and green(Host name) colour one as your
require...
# cat etc/hosts
#
# Internet host
table
#
::1 localhost
127.0.0.1 localhost
172.16.0.1 NTU-HQ-EMS
loghost
#
# cat /etc/inet/ipnodes
#
# Internet host
table
#
::1 localhost
127.0.0.1 localhost
172.16.0.1 NTU-HQ-EMS loghost
#
Once done, restart the Network service using following
command:
# svcadm restart network/physical
Or reboot the server for the changes to take effect.
Check
your physical network is up and running:
# svcs |grep -i physical
online
Feb_08
svc:/network/physical:default
#
Note:
The /etc/inet/ipnodes file stores
both IPv4 and IPv6 addresses.
If you need to change addresses, you must
add IPv4 addresses to both the hosts and ipnodes files. You add only IPv6 addresses to the ipnodes file.
Also, ensure that the /etc/netmasks file with the network ID
and the netmask.