自学内容网 自学内容网

ubuntu bind9 主从配置

主配置 (master)

# cat /etc/bind/named.conf.local
zone "xxx.com" {
        type master;
        file "/var/lib/bind/xxx.com.hosts";
        also-notify {
                172.17.151.242; // 从IP
                };
        };

# cat /var/lib/bind/xxx.com.hosts
$ttl 3600
xxx.com.        IN      SOA     xxx-dns1. xxx.xxx.com. (
                        2024051103
                        3600
                        600
                        1209600
                        3600 )
xxx.com.        IN      NS      xxx-dns1.
xxx.xxx.com.   IN      A       172.17.151.35

从配置 (slave)

# cat /etc/bind/named.conf.local
zone "xxx.com" {
        type slave;
        masters {
                172.17.151.241; // 主机IP
                };
        file "/var/lib/bind/xxx.com.hosts";
        };

两台服务器同时重起服务

# systemctl restart named.service
# systemctl status named.service

同步过程中发生报错

# journalctl -xeu named.service

named[9226]: zone mes.com/IN: transfer: could not set file modification time of '/var/lib/bind/xxx.com.hosts': permission denied

初步判断为文件权限问题
使用命令 调整与bind权限一致的owner即可解决

# chown bind:bind xxx.hosts

原文地址:https://blog.csdn.net/hoffmannlin/article/details/138712467

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!