[size=5][color=#87CEEB]1 安装 bind-chroot-9.2.4-2[/color][/size]
bind-libs-9.2.4-2
ypbind-1.17.2-3
bind-utils-9.2.4-2
bind-9.2.4-2
bind-devel-9.2.4-2
bind-chroot-9.2.4-2
[color=#87CEEB]2 在/var/named 下做link [/color]
55.net -> /var/named/chroot/var/named/55.net
55.net.local -> /var/named/chroot/var/named/55.net.local
localdomain.zone -> /var/named/chroot/var/named/localdomain.zone
localhost.zone -> /var/named/chroot/var/named/localhost.zone
localtime -> /var/named/chroot/var/named/localtime
named.broadcast -> /var/named/chroot/var/named/named.broadcast
named.ca -> /var/named/chroot/var/named/named.ca
named.conf -> /var/named/chroot/etc/named.conf
named.ip6.local -> /var/named/chroot/var/named/named.ip6.local
named.local -> /var/named/chroot/var/named/named.local
named.zero -> /var/named/chroot/var/named/named.zero
rndc.key -> /var/named/chroot/etc/rndc.key
[file][attach]3[/attach][/file]
其中 所有bind的文件在 bind.tar.gz 压缩包里。
[color=#87CEEB]3 配置主dns的named.conf文件内容为[/color]
// Default named.conf generated by install of bind-9.2.4-2
options {
listen-on port 53 {192.168.0.105;};
#listen-on-v6 port 53 {::1;};
notify yes;
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
query-source port 53;
#query-source-v6 port 53;
allow-query {any;};
zone "." IN {
type hint;
file "named.ca";
#zone "localdomain" IN {
# type master;
# file "localdomain.zone";
# allow-update { none; };
#};
#zone "localhost" IN {
# type master;
# file "localhost.zone";
# allow-update { none; };
#};
[newpage]
#zone "0.0.127.in-addr.arpa" IN {
# type master;
# file "named.local";
# allow-update { none; };
#};
zone "55.net" IN {
type master;
file "55.net";
also-notify {192.168.0.120;};
allow-transfer {192.168.0.120;};
allow-update { none; };
zone "55.net.local" IN {
type master;
file "55.net.local";
allow-transfer {192.168.0.120;};
allow-update { none; };
include "/etc/rndc.key";
[color=#87CEEB]4 配置正向域名的配置文件 55.net文件如下[/color]
$TTL 86400
@ IN SOA vk2.55.net. root.vk2.55.net. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS vk2.55.net.
IN NS ns2.55.net.
IN A 192.168.0.105
IN AAAA ::1
localhost IN A 127.0.0.1
sdf IN A 192.168.0.100
4674076e791e469 IN A 192.168.0.66
www IN A 192.168.0.105
ftp IN A 192.168.0.105
mail IN A 192.168.0.105
@ IN MX 10 mail.55.net.
vk2 IN A 192.168.0.105
[color=#87CEEB]5 方向区域的配置文件 55.net.loca文件如下[/color]
$TTL 86400
@ IN SOA vk2.55.net. root.vk2.55.net. (
1997022711 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS vk2.55.net.
IN NS ns2.55.net.
100 IN PTR sdf.55.net.
66 IN PTR 4674076e791e469.55.net.
105 IN PTR www.55.net.
105 IN PTR ftp.55.net.
105 IN PTR mail.55.net.
105 IN PTR vk2.55.net.
[color=#87CEEB]6 修改/var/named 目录为named:named[/color]
[color=#FF0000] [size=5] 主DNS 配置完毕[/size][/color]
[newpage]
[color=#0000FF]从DNS 配置[/color]
[color=#00008B]1 安装 bind-chroot-9.2.4-2[/color]
bind-libs-9.2.4-2
ypbind-1.17.2-3
bind-utils-9.2.4-2
bind-9.2.4-2
bind-devel-9.2.4-2
[color=#00008B]2 在/var/named 下做link[/color]
55.net -> /var/named/chroot/var/named/55.net
55.net.local -> /var/named/chroot/var/named/55.net.local
localdomain.zone -> /var/named/chroot/var/named/localdomain.zone
localhost.zone -> /var/named/chroot/var/named/localhost.zone
localtime -> /var/named/chroot/var/named/localtime
named.broadcast -> /var/named/chroot/var/named/named.broadcast
named.ca -> /var/named/chroot/var/named/named.ca
named.conf -> /var/named/chroot/etc/named.conf
named.ip6.local -> /var/named/chroot/var/named/named.ip6.local
named.local -> /var/named/chroot/var/named/named.local
named.zero -> /var/named/chroot/var/named/named.zero
rndc.key -> /var/named/chroot/etc/rndc.key
[color=#00008B]3 /etc/named.conf 文件如下[/color]
// Default named.conf generated by install of bind-9.2.4-2
options {
listen-on port 53 {192.168.0.120;};
#listen-on-v6 port 53 {::1;};
# notify yes;
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
query-source port 53;
#query-source-v6 port 53;
allow-query {any;};
zone "." IN {
type hint;
file "named.ca";
#zone "localdomain" IN {
# type master;
# file "localdomain.zone";
# allow-update { none; };
#};
#zone "localhost" IN {
# type master;
# file "localhost.zone";
# allow-update { none; };
#};
#zone "0.0.127.in-addr.arpa" IN {
# type master;
# file "named.local";
# allow-update { none; };
#};
zone "55.net" IN {
type slave;
file "slaves/55.net";
masters { 192.168.0.105;};
#allow-update { none; };
zone "55.net.local" IN {
type slave;
file "/slaves/55.net.local";
masters { 192.168.0.105;};
# allow-update { none; };
include "/etc/rndc.key";
[color=#00008B]4 修改/var/named 目录权限。[/color]
[color=#FF6347]
不需要创建 55.net 和55.net.local 文件了 重启主DNs 和从dns 后会自动同步过去 如果不能同步 修改主dns的serial值 大于辅助DNS的serial值。[/color]
[color=#00008B]5 主DNS和辅助dns本地的dns 都设置成自己 进行测试[/color]
原文链接:https://blog.csdn.net/weixin_42140846/article/details/116886227