一般主机IP地址的解析顺序依次是DNS,NIS,本机host档案。
要改变这个顺序, 在AIX中,可以建立一个/etc/netsvc.conf文件,并在这个档案中加一行:
hosts=local,bind,nis
这样主机IP地址就先从本地档案(/etc/hosts)开始搜索,其次再去DNS server,最後是NIS server。
也可通过执行
很多系统都由这个文件来指定: /etc/nsswitch.conf
AIX上面就是这个文件/etc/netsvc.conf
# The /etc/netsvc.conf file is used to specify the ordering of name resolution for
# gethostbyname, gethostbyname2, gethostbyaddr routines
# and alias resolution for the sendmail command.
# Any host setting defined in /etc/netsvc.conf file will override the default host order
# and the host setting given in the /etc/irs.conf file.
# The environment variable NSORDER overrides the host settings in the /etc/netsvc.conf file,
# which in turn overrides the host settings in the /etc/irs.conf file.
| | |
| | 在AIX中何时才需要用 /etc/resolv.conf | /etc/resolv.conf 不是AIX中必需的文件. 只有在配置和使用DNS的环境中才需要此文件. 若AIX服务器是DNS服务器,则此文件可包含本机地址 ,loopback地址, 或者内容为空.若AIX服务器是DNS客户端, 则此文件包含 domain 名 和 DNS服务器的IP地址.
如: 在DNS服务器上的 内容为: # cat /etc/resolv.conf nameserver 127.0.0.1 domain test.ibm.com 在DNS客户端,其内容为: # cat /etc/resolv.conf domain test.ibm.com nameserver 9.3.240.59 nameserver 9.3.240.58 如果该服务器不使用DNS机制,最好将此文件从系统中删除. 否则会影响到使用主机名进行通讯的应用. 因为AIX系统中,缺省的主机名解析顺序是DNS,NIS,local. |
|
|
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7734298/viewspace-703511/
,如需转载,请注明出处,否则将追究法律责任。