Debian的BIND9的配置

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.

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值