AIX中的/etc/netsvc.conf及/etc/resolv.conf

一般主机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博客 ” ,链接:http://blog.itpub.net/7734298/viewspace-703511/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7734298/viewspace-703511/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值