当前位置: 代码迷 >> Solaris >> 在Solaris中配备DNS
  详细解决方案

在Solaris中配备DNS

热度:3285   发布时间:2013-02-26 00:00:00.0
在Solaris中配置DNS
一般来讲在安装的时候就应该已经把nameserver相关的东西都配置好了。
不过我安装的时候配错了。。。

这是最简单的DNS静态指定IP的配置方法,目的是让「ping www.google.com」这个命令能ping通。
需要修改或者添加以下两个文件:
? /etc/resolv.conf
? /etc/nsswitch.conf

这里默认网卡是被安装并且被正确配置的。

/etc/resolv.conf

#为nameserver指定IP地址,这里指定的是我的路由器地址#如果这个文件不存在,新建一个,然后加上这一行nameserver 192.168.11.1


保存之后试试「nslookup www.google.com」,如果能找到网址就说明配对了

# nslookup www.google.comServer:         192.168.11.1Address:        192.168.11.1#53Non-authoritative answer:www.google.com  canonical name = www.l.google.com.Name:   www.l.google.comAddress: 66.249.89.99Name:   www.l.google.comAddress: 66.249.89.104


/etc/nsswitch.conf

#找到 hosts 这一行,在后面追加 dnshosts:      files dns


保存后外面的域名应该就可以ping通了

# ping www.gogle.comwww.gogle.com is alive