系统主机名在 svc:/system/identity:node 服务中设置。例如,主机名为 sys-A,IPFC 网络接口为 fcip0。
# svccfg -s identity:node svc:/system/identity:node> listprop config/nodename config/nodename astring sys-A
如果需要设置主机名,请使用类似以下的语法:
# svccfg -s identity:node setprop config/nodename = "neo-1"
安装程序将以最少条目创建 /etc/inet/hosts 文件。您必须使用文本编辑器手动添加其他条目。有关其他信息,请参见 hosts(4)。
/etc/inet/hosts 文件包含主机数据库。此文件包含主机名和主网络接口 IP 地址,以及附加到系统的其他网络接口和计算机必须了解的任何其他网络接口的 IP 地址。
以下示例所示为 etc/inet/host 文件。
127.0.0.1 localhost loghost 192.168.200.70 neo-1 #This is the local host name 192.168.201.10 fcip0 #Interface to network 192.168.201.10
# svccfg svc:> select network/nis/client:default svc:/network/nis/client:default> select name-service/switch svc:/system/name-service/switch> listprop config/host config/host astring "files nis" svc:/system/name-service/switch> quit