Debian的BIND9配置
安装包:
apt install bind9
对bind9的一些操作命令:
systemctl status bind9 —查看bind9的状态
systemctl restart bind9 —重启bind9
粗略的日志:
/var/log/messages 它只记录了一些服务启动时的严重错误
配置目录:
/etc/bind/named.conf----------------------主配置文件
/etc/bind/named.conf.default.zones----区域文件
/etc/bind/named.conf.options------------全局配置文件
**主配置文件:/etc/bind/named.conf
root@storageserver:/etc/bind# cat 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”; ##它们是指定了
include “/etc/bind/named.conf.local”; #####一个其他的配配置文件
include “/etc/bind/named.conf.default-zones”;
**区域文件:/etc/bind/named.conf.default.zones
root@storageserver:/etc/bind# cat named.conf.default-zones
zone “.” {
type hint;
file “/etc/bind/db.root”;
};
zone “aa.com” { --------##主区域##--------------
type master;
file “/etc/bind/master.zone”;
allow-transfer {}; ##允许谁对这个zone进行转发
};
zone “bb.aa.com” { --------##辅助区域##---------
type slave;
file “/etc/bind/slave”;
masters {192.168.10.1;}; ##主zone服务器的IP地址
};
zone “aa.com” IN { ----------##转发区域##------------
type forward;
forward first|only;
forwarders {192.168.10.1;}; ##转发的地址
};
关于子域的问题可以配合转发区域使用,解决子域无法解析主域的问题
…**
泛解析:
在zone中加入一条A记录,在想泛解析的地方加入* 这样所有的以aa.com结尾的请求,都将会解析出192.168.10.1这个ip地址
*.aa.com. A 192.168.