BIND 和 DHCPD 已配置,但据我所知,DHCPD 甚至不会尝试向 BIND 发送动态 DNS 更新。我可以使用 nsupdate 手动添加记录,其密钥与我配置 DHCPD 使用的密钥相同。
服务器:
eth0:10.0.0.1 静态(BIND 和 DHCPD) eth1:DHCPd 分配(外部,不同子网)
客户:
eth0:已分配 DHCP,与服务器 eth0 位于同一子网
DHCPD 配置:
authoritative;
option domain-name "ops.ss";
option domain-name-servers testvm1.ops.ss;
ddns-updates on;
ddns-update-style interim;
default-lease-time 3600;
max-lease-time 7200;
log-facility local6;
key DDNS_UPDATE {
algorithm HMAC-MD5.SIG-ALG.REG.INT;
secret "manysecrets";
}
zone ops.ss. {
primary 127.0.0.1;
key DDNS_UPDATE;
}
zone 0.0.10.in-addr.arpa. {
primary 127.0.0.1;
key DDNS_UPDATE;
}
subnet 10.0.0.0 netmask 255.255.255.0 {
range 10.0.0.50 10.0.0.99;
option routers 10.0.0.1;
}
BIND配置:
include "/etc/named/ddns.key";
acl trusted {
10.0.0.0/24;
127.0.0.0/8;
localnets;
localhost;
};
options {
listen-on port 53 { trusted; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { trusted; };
forwarders { 192.168.1.2; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
channel update_log {
file "data/bind-updates.log";
severity debug;
print-category yes;
print-severity yes;
print-time yes;
};
category update {
update_log;
};
category update-security {
update_log;
};
};
zone "." IN {
type hint;
file "named.ca";
};
zone "ops.ss" IN {
type master;
file "dynamic/fwd_ops.ss";
allow-update { key DDNS_UPDATE; };
};
zone "0.0.10.in-addr.arpa." {
type master;
file "dynamic/rev_10.0.0.0_24";
allow-update { key DDNS_UPDATE; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
两个系统都是 CentOS 6.4,带有来自@updates 的 bind 和 dhcp
答案1
DHCPD 不会将更新推送到 BIND,因为没有定义 DDNS 主机名,所以它不知道要更新什么 DNS 名称。
答案2
根据手册页ddns-hostname
不需要设置。
The ddns-hostname statement
ddns-hostname name;
The name parameter should be the hostname that will be used in set-
ting up the client's A and PTR records. If no ddns-hostname is spec-
ified in scope, then the server will derive the hostname automati-
cally, using an algorithm that varies for each of the different
update methods.
答案3
确保 dhcp 客户端确实发送了主机名。在 Ubuntu 中,dhclient.conf 中的以下选项可执行此操作:
send host-name = gethostname();
乍一看,您的命名配置似乎不错。
这是我的 DHCP 服务器设置。我使用 RNDC 密钥:
subnet 192.168.20.0 netmask 255.255.255.0 {
range 192.168.20.100 192.168.20.200;
option subnet-mask 255.255.255.0;
option routers 192.168.20.1;
option domain-name-servers 192.168.20.201;
option domain-name "srv.internal.mycompany.be";
ddns-domainname "srv.internal.mycompany.be.";
ddns-rev-domainname "in-addr.arpa.";
}
确保指定了 ddns-domainname,这样它就知道要更新哪些区域记录。不要忘记末尾的额外“点”。