DNS安装配置
- 安装Bind软件:
rpm -qa | grep bind bind-utils-9.8.2-0.23.rc1.el6_5.1.x86_64 bind-9.8.2-0.23.rc1.el6_5.1.x86_64 bind-libs-9.8.2-0.23.rc1.el6_5.1.x86_64
- 配置named.conf , vi /data/sdns/named/etc/named.conf
zone "fww.com" IN { type master; file "fww.zone"; allow-update { none; }; }; zone "23.144.10.in-addr.arpa" IN { type master; file "fww.23.144.10"; allow-update { none; }; };
注意的是zone "fww.com",域名即为***.fww.com。zone "23.144.10.in-addr.arpa"表示的是解析IP为10.144.23.***机器的域名
- 建立区目录文件
mkdir /data/sdns/zone cd /data/sdns/zone
- 编辑fww.zone
$TTL 86400 @ IN SOA localhost. root. ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum IN NS localhost. ns IN A 10.144.23.23 ftp IN A 10.144.23.23 lee.fww IN A 10.144.23.23
注意一:IN NS localhost. 前面要有空格。注意二:ns IN A 10.144.23.23 要顶格写。
- 编辑fww.23.144.10
$TTL 86400 @ IN SOA mylocal. root.localhost. ( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS fww.com. 23 IN PTR ns.fww.com. 23 IN PTR ftp.fww.com.
23 IN PTR ns.fww.com. 表明 10.144.23.23 对应的域名为ns.fww.com
- 编辑named.root,同在/data/sdns/zone
dig > named.root
- 启动bind
/data/sdns/named/sbin/named -c /data/sdns/named/etc/named.conf &
- 验证域名
nslookup ftp.fww.com Server: 10.144.23.23 Address: 10.144.23.23#53 Name: ftp.fww.com Address: 10.144.23.23
红字表示域名对应的ip找到了。
nslookup 10.144.23.23 Server: 10.144.23.23 Address: 10.144.23.23#53 23.23.144.10.in-addr.arpa name = ftp.fww.com. 23.23.144.10.in-addr.arpa name = ns.fww.com.
红字表示 找到IP对应的域名了。