- 论坛徽章:
- 0
|
(第四章:DNS客户端的设置)\r\n\r\n/etc/resolv.conf文件 \r\n记录DNS服务器的地址和域名 \r\n关键字: \r\ndomainname \r\nnameserver \r\n# more /etc/resolv.conf \r\nnameserver 172.16.255.3 \r\ndomainname sunrise.com.cn \r\n\r\n/etc/nsswitch.conf文件 \r\n记录主机名的搜索顺序等信息 \r\n# more /etc/nsswitch.conf \r\n# \r\n# /etc/nsswitch.dns: \r\n# \r\n# An example file that could be copied over to /etc/nsswitch.conf; it uses \r\n# DNS for hosts lookups, otherwise it does not use any other naming service. \r\n# \r\n# \"hosts:\" and \"services:\" in this file are used only if the \r\n# /etc/netconfig file has a \"-\" for nametoaddr_libs of \"inet\" transports. \r\n\r\npasswd: files \r\ngroup: files \r\n# You must also set up the /etc/resolv.conf file for DNS name \r\n# server lookup. See resolv.conf(4). \r\nhosts: files dns \r\nipnodes: files \r\n… \r\n… \r\n\r\n将这个文件的hosts记录配置成hosts: files dns \r\n\r\nnslookup命令 \r\n用于查询DNS服务器 \r\n用于验证客户端的设置 \r\n用于下载DNS数据库 \r\n\r\n# nslookup \r\nDefault Server: ns.zjhzptt.net.cn \r\nAddress: 202.96.96.68 \r\n\r\n> www.sun.com \r\nServer: ns.zjhzptt.net.cn \r\nAddress: 202.96.96.68 \r\n\r\nNon-authoritative answer: \r\nName: www.sun.com \r\nAddress: 192.18.97.241 \r\n\r\n> \r\n启动时,nslookup缺省地以本地服务器为目标。响应中包括目标服务器的名字和地址。>是提示符,这意味着可以开始发送名字服务询问或配置。 |
|