免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1078 | 回复: 0
打印 上一主题 下一主题

实战solaris之域名系统文件配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-20 13:13 |只看该作者 |倒序浏览

[实战solaris之域名系统文件配置]

一、摘要
实战solaris之域名系统文件配置,配置/etc/ nsswitch.conf 、resolv.conf 、hosts
使服务器能够访问(ping)域名。

二、正文
#ping
www.163.com
no answer from
www.163.com
1.配置nsswitch.conf文件,主要是hosts项,如下所示:
#vi /etc/nsswitch.conf
#
# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
passwd:     files
group:      files
hosts:      files       dns
ipnodes:    files
networks:   files
protocols:  files
rpc:        files
ethers:     files
netmasks:   files
bootparams: files
publickey:  files
# At present there isn't a 'files' backend for netgroup;  the system will
#   figure it out pretty quickly, and won't use netgroups at all.
netgroup:   files
automount:  files
aliases:    files
services:   files
sendmailvars:   files
printers:       user files

auth_attr:  files
prof_attr:  files
project:    files


hosts:      files       dns
/*此处配置说明先用files后用dns;files配置见/etc/hosts;dns配置见/etc/resolv.conf*/

2.配置hosts文件
    hosts配置本地域名解析。
#vi /etc/hosts
#
# Internet host table
#
127.0.0.1       localhost
218.25.254.24   loghost
192.168.4.102   ora-vp

3.配置resolv.conf文件
     /etc/resolv.conf配置远程域名解析服务器,如下202.96.64.68为域名服务器。
#vi /etc/resolv.conf
nameserver      202.96.64.68

如上配置,当ping loghost时,系统首先在/etc/hosts查找,由于nsswitch.conf文件中hosts项已配置,找到对应地址218.25.254.24;当ping
www.163.com
时,由于本地hosts没有找到匹配项,所以系统会访问resolv.conf中配置的域名服务器解析。

文件:
[HOLER]实战solaris之域名系统文件配置.rar
大小:
5KB
下载:
下载
holer
holeryu@hotmail.com
http://holeryu.cublog.cn/
http://blog.csdn.net/holeryu/


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/16991/showart_343489.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP