在SUN機器上設置DNS客戶端需要二個步驟: 1.創建/etc/resolv.conf文件 一個示例的resolv.conf文件如下: domain sun.com nameserver 127.0.0.1 nameserver 192.1.0.11 nameserver 192.1.0.10 文件中主要包含二部分內容,第一行是 domain 你申請的域名,例,申請域名為piecust-cn.net.edu.cn,則寫為: domain piecust-cn.net.edu.cn 第二行是名稱服務器,示例表示本機就是DNS服務器,其格式為 nameserver ip地址,該段可以是DNS的主域名稱服務器、備份域名稱服務器或緩沖名稱服務器,但是書寫時不可以超過3個服務器。如果網絡中只有一個DNS服務器且地址為192.1.0.11,則可以寫為: nameserver 192.1.0.11 2.修改/etc/nsswitch.conf,是客戶機能夠使用DNS服務 SUN客戶機缺省使用files作為服務器名字的解析,為了使用DNS名稱解析服務器,必須在/etc/nsswitch.conf指明使用DNS服務。 # # /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 networks: files dns 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 如上例,只要在hosts一項添加dns項就可以 |
|
新聞熱點
疑難解答