solairs10的IP地址及主机名的配置文件.共有四个:
/etc/hostname.pcn0
/etc/hosts
/etc/netmasks
/etc/defaultrouter
/etc/hostname.pcn0这个里面记录的本机的机器名;
/etc/hosts是一个指向/etc/inet/hosts的一个软链接,记录的是IP地址和机器名的对应关系;
vi /etc/inet/hosts
127.0.0.1 localhost
192.168.224.251 outer outer.c204.com loghost
192.168.1.1 inner inner.c204.com
/etc/netmasks是指向/etc/inet/netmasks的一个软链接,里面记录的是网络地址和子网掩码的对应关系.;
vi /etc/inet/netmasks
192.168.224.0 255.255.255.0
192.168.1.0 255.255.255.0
/etc/defaultrouter是默认网关。
修改完成后,reboot
问题:若是修改以上内容,reboot后,ifconfig -a的信息还是没有变化。
问题可能出在/etc/inet/ipnodes文件。该文件的语法跟/etc/hosts相同,但优先级高于/etc/hosts。如果/etc/inet/ipnodes文件中保留了原来的IP地址,那么/etc/hosts中相同hostname的IP设置将被忽略。将ipnodes文件中的IP地址一行删掉,或改成新的IP地址,重启后,问题就消失了