主配置 (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
Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐