费尽周折,终于可以用了,不过只做了一个简单的,记录一下配置:

named.conf:

// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";

// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
type master;
file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};

zone "wang.home" {
type master;
file "/etc/bind/db.wang.home";
};

zone "56.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.56.168.192";
};

include "/etc/bind/named.conf.local";

db.wang.home:

;
; BIND data file for local loopback interface
;
$TTL    604800
@   IN  SOA ubsrv.wang.home. root.ubsrv.wang.home. (
2       ; Serial
604800      ; Refresh
86400       ; Retry
2419200     ; Expire
604800 )    ; Negative Cache TTL
;
@   IN  NS  dns.wang.home.
@   IN  A   127.0.0.1
@   IN  AAAA    ::1
ubsrv   IN  A   192.168.56.100
xp  IN  A   192.168.56.4
mail    IN  CNAME   ubsrv
dns IN  CNAME   ubsrv

db.56.168.192:

;
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@   IN  SOA dns.wang.home. root.dns.wang.home. (
1       ; Serial
604800      ; Refresh
86400       ; Retry
2419200     ; Expire
604800 )    ; Negative Cache TTL
;
@   IN  NS  dns.wang.home.
100 IN  PTR ubsrv.wang.home.
4   IN  PTR xp.wang.home.

/etc/resolve.conf 指向本机

这里只做了2台主机的解析,不知道有没有办法让dns自动记录域内的主机名,那些高级命令,什么acl 什么view的,实在是看不懂,先放一放,下一步学习samba和ldap,建立linux的域环境,不知道先学哪个?

DNS服务器设置

bind9-chs