ubuntu bind9 配置简单记录
ubuntu版本:Ubuntu 12.04.2
bind9安装:apt-get install bind9
bind9配置文件目录:/etc/bind
bind9主要配置文件:named.conf.local以及对应db配置
1,主服务器配置:
root@ubuntu:/etc/bind# more named.conf.local
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "example.com" {
type master;
file "/etc/bind/db.example.com";
};
root@ubuntu:/etc/bind# more db.example.com
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA localhost. root.localhost. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
@ IN A 127.0.0.1
@ IN AAAA ::1
www IN A 123.123.123.123
mail IN A 123.123.123.123
2,测试:
root@ubuntu:/etc/bind# dig @localhost mail.example.com A
; <<>> DiG 9.8.1-P1 <<>> @localhost mail.example.com A
;; QUESTION SECTION:
;mail.example.com. IN A
;; ANSWER SECTION:
mail.example.com. 604800 IN A 123.123.123.123
3,缓存服务器配置(centos5.5):
[root@in ~]# more /etc/named.conf
options {
forwarders {192.168.100.10;};
forward only;
};