快速业务通道

bind9 DNS配置

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-03-27

1. master server configure
# domain: test.com
# ip: 192.168.1.107

1.1 install bind9
aptitude install bind9

1.2 configure /etc/bind/name.conf
#bakup named.conf
cp /etc/bind/named.conf /etc/bind/named.conf.default

add next
# 正向解析
zone "test.com" {
type master;
file "/etc/bind/db.test";
allow-transfer { 192.168.1.109 ; }; #update slave server 192.168.1.109 db.test
notify yes;
also-notify { 192.168.1.109 ; };

};

#反向解析
zone "1.168.192.in-addr.arpa"{
type master;
file "/etc/bind/db.192.168.1";
allow-transfer { 192.168.1.109 ; }; #update slave server 192.168.1.109 db.test
notify yes;
also-notify { 192.168.1.109 ; };
};


1.3 add /etc/bind/db.test db.192.168.1
vim /etc/bind/db.test

#db.test
$TTL 86400
$ORIGIN test.com.
@ IN SOA test.com. root.test.com. (
20090201 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
@ IN NS test.com.
www IN A 192.168.1.136
ftp IN A 192.168.1.107

#db.192.168.1
$TTL 86400
@ IN SOA test.com. root.test.com. (
20090201 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
@ IN NS test.com.
136 IN PTR www.test.com. #其中“.”加上


1.4 restart bind9 or reload named.conf config
/etc/init.d/bind9 restart
or
rndc reload

2. slave server configure
# ip: 192.168.1.109

2.1 install bind9
aptitude install bind9

2.2 config /etc/bind/named.conf
#add next
zone "test.com" {
type slave; #slave server
file "/etc/bind/db.test";
masters {192.168.1.107;}; #master server is 192.168.1.107
};

zone "1.168.192.in-addr.arpa"{
type master; #slave server
file "/etc/bind/db.192.168.1";
masters {192.168.1.107;}; #master server is 192.168.1.107
};

2.3 add /etc/bind/db.test /etc/bind/db.192.168.1
#copy there form master server 192.168.1.107
#if you want update slave server config, the "serial" must < serial on master server

2.4 change /etc/bind proteries
chown bind /etc/bind
#if you do not change, slalve can not update successfull. permission denied

2.5 restart bind


3. test dns

# 正向测试
aptitude install dnsutils
dig -x 192.168.1.107

# 反向测试

windows xp tools: nslookup

本文出自 “飞翔的人生” 博客,请务必保留此出处http://3619523.blog.51cto.com/3609523/671896

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号