使用静态 IP 更新绑定

使用静态 IP 更新绑定

使用动态 PC 时,日志为:

dhcpd[4574]: Added new forward map from test00.example.com. to 192.168.1.78
dhcpd[4574]: Added reverse map from 78.1.168.192.in-addr.arpa. to test00.example.com.

使用静态IP,日志是:

dhcpd[4574]: DHCPDISCOVER from c8:d3:a3:34:d1:1d (dlinkrouter) via enp2s0
dhcpd[4574]: DHCPOFFER on 192.168.1.51 to c8:d3:a3:34:d1:1d (dlinkrouter) via enp2s0
dhcpd[4574]: DHCPREQUEST for 192.168.1.51 (192.168.1.100) from c8:d3:a3:34:d1:1d (dlinkrouter) via enp2s0
dhcpd[4574]: DHCPACK on 192.168.1.51 to c8:d3:a3:34:d1:1d (dlinkrouter) via enp2s0

是否可以使用静态 IP 更新绑定的正向和反向映射?

cat /etc/dhcp/dhcpd.conf

authoritative;
ddns-updates on;
ddns-update-style interim;
update-static-leases on;
ddns-domainname "example.com.";
ddns-rev-domainname "in-addr.arpa.";
allow client-updates;

default-lease-time 600;
max-lease-time 7200;

log-facility local7;

include "/etc/dhcp/example.com.key";

zone example.com. {
  primary 192.168.1.101;
  key rndc-key;
}

zone 1.168.192.in-addr.arpa. {
  primary 192.168.1.101;
  key rndc-key;
}

subnet 192.168.1.0 netmask 255.255.255.0 {
        range 192.168.1.50 192.168.1.90;
        option broadcast-address 192.168.1.255;
        option netbios-name-servers 192.168.1.100;
        option domain-name-servers 192.168.1.101, 8.8.8.8, 8.8.4.4;
        option routers 192.168.1.100;
        option domain-search "example.com";
        default-lease-time 600;
        max-lease-time 7200;
}

答案1

正如评论中提到的,您可能应该将映射放在区域中。如果您坚持要求 DHCP 服务器添加静态租约映射,则必须使用以下命令专门启用它:

update-static-leases            true;

在您的 dhcpd.conf 文件中。

还请注意,如果您的 dhcp 客户端不发送 fqdn.fqdn 选项,那么您可能必须在主机声明中包含 ddns-hostname。

相关内容