Debian 配置Bind9 DNS服务器
1 Installing bind<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
apt-get install bind
2 Configure bind
编辑bind配置named.conf;
vi /etc/bind/named.conf
添加一个"zone"区域;
zone "sip.com" {
type master;
file "named.sip.com";
};
注意options中的directory,这里放置所有的zone file
;3 Configure zone file
我们这里添加的是named.sip.com
vi /etc/bind/named.sip.com
; BIND db file for sip.com
$TTL 86400
@ IN SOA primary.sip.com. admin.sip.com. (
2008090301 ; serial number YYMMDDNN
28800 ; Refresh
7200 ; Retry
864000 ; Expire
86400 ; Min TTL
)
NS primary.sip.com.
NS secondary.sip.com.
MX 10 mail.sip.com.
MX 20 mail-spool.sip.com.
_sip._udp SRV 0 1 9 primary.sip.com. ;SRV 记录
SRV 0 3 9 secondary.sip.com.
primary IN A<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899"><span style="mso-tab-count: 2"> </span>10.30.32</chsdate>.30
secondary IN A<chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899"><span style="mso-tab-count: 2"> </span>10.30.32</chsdate>.31
mail IN A<chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899"><span style="mso-tab-count: 2"> </span>10.30.32</chsdate>.32
mail-spool IN A<chsdate w:st="on" isrocdate="False" islunardate="False" day="30" month="12" year="1899"><span style="mso-tab-count: 2"> </span>10.30.32</chsdate>.34
$ORIGIN sip.com.
4 Test
echo "nameserver 127.0.0.1" > /etc/resolv.conf
/etc/init.d/bind start
dig primary.sip.com
dig -t SRV _sip._udp.sip.com
note:
可以通过http://pgl.yoyo.org/adservers/bind-zone-file-creator.php这个PHP 生成需要的zone file, 自己修改!