solaris上配置DNS客戶端
it.Phontol.com
it.Phontol.com 在SUN機器上設置DNS客戶端需要二個步驟:
it.Phontol.com
it.Phontol.com 1.創建/etc/resolv.conf文件
it.Phontol.com 一個示例的resolv.conf文件如下:
it.Phontol.com domain sun.com
it.Phontol.com nameserver 127.0.0.1
it.Phontol.com nameserver 192.1.0.11
it.Phontol.com nameserver 192.1.0.10
it.Phontol.com 文件中主要包含二部分內容,第一行是
it.Phontol.com domain 你申請的域名,例,申請域名為piecust-cn.net.edu.cn,則寫為:
it.Phontol.com domain piecust-cn.net.edu.cn
it.Phontol.com 第二行是名稱服務器,示例表示本機就是DNS服務器,其格式為
it.Phontol.com nameserver
it.Phontol.com IP地址,該段可以是DNS的主域名稱服務器、備份域名稱服務器或緩沖名稱服務器,但是書寫時不可以超過3個服務器。it.Phontol.com如果網絡中只有一個DNS服務器且地址為192.1.0.11,則可以寫為:
it.Phontol.com nameserver 192.1.0.11
it.Phontol.com
it.Phontol.com 2.修改/etc/nsswitch.conf,是客戶機能夠使用DNS服務
it.Phontol.com SUN客戶機缺省使用files作為服務器名字的解析,為了使用DNS名稱解析服務器,必須在/etc/nsswitch.conf指明使用DNS服務。it.Phontol.com
it.Phontol.com #
it.Phontol.com # /etc/nsswitch.files:
it.Phontol.com #
it.Phontol.com # An example file that could be copied over to /etc/nsswitch.conf; it
it.Phontol.com # does not use any naming service.
it.Phontol.com #
it.Phontol.com # "hosts:" and "services:" in this file are used only if the
it.Phontol.com # /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
passwd: files
it.Phontol.com group: files
it.Phontol.com hosts: files dns
it.Phontol.com networks: files dns
it.Phontol.com protocols: files
it.Phontol.com rpc: files
it.Phontol.com ethers: files
it.Phontol.com netmasks: files
it.Phontol.com bootparams: files
it.Phontol.com publickey: files
it.Phontol.com # At present there isn't a 'files' backend for netgroup; the system will
it.Phontol.com # figure it out pretty quickly, and won't use netgroups at all.
it.Phontol.com netgroup: files
it.Phontol.com automount: files
it.Phontol.com aliases: files
it.Phontol.com services: files
it.Phontol.com sendmailvars: files
it.Phontol.com 如上例,只要在hosts一項添加dns項就可以forums.Phontol.com
更改後不必重新啟動機器和服務器,直接可以用,比linux多了一個文件,不知有沒有aix5l那樣的方便工具forums.Phontol.com