Skip to content
Geek is the Way!
Menu
  • Forums
  • Sobre o blog
  • Contato
  • English
Menu

Configuring DHCP Dynamic Host registration on DNS Bind9 on your pfSense

Posted on March 18, 2023March 18, 2023 by Thiago Crepaldi

Last Updated on March 18, 2023 by Thiago Crepaldi

On a previous post, we’ve discussed how to use Bind9 on your pfSense in a way that external names were forwarded to other name servers and internal names were statically resolved. In this post, we are going to integrate pfSense’s DHCP Server and Bind9, so that when DHCP assigns an IP to a device, it informs Bind9 to add DNS entries for them.

pfBlockerNG depends on Unbound, so don’t replace it with Bind if you still want to block stuff with it.

This integration requires changes on both Bind and DHCP Server, to allow them to communicate securely. The first step is creating a secret key that will be shared by both services. Run the following on your pfSense or on a linux machine with bid9 package installed:

tsig-keygen -a HMAC-SHA256 dhcpupdate

The output would be something similar to:

key "dhcpupdate" {
        algorithm hmac-sha256;
        secret "rgZrbe9tzrI5GbL7weyaIY7f9AKbq0xc+76XuoS2muI=";
};

Now that we have a key, we need to configure bind to use it. Go to Service >> BIND DNS Server. In the Settings tab, scroll down and click on Show Advanced Options and paste the key entry as returned by tsig-keygen at the Global Settings field and click on Save.

Next go to ACLs tab and click on Add

  • ACLs
    • General Options:
      • ACL Name: DHCPUpdate-ACL
      • Description: ACL for DHCP Updates
      • Enter IP or network range block: key dhcpupdate

Click on Save. Now we have to change both the forward and reverse zones to use the dhcpupdate key for DNS updates.

For the forward zone, click on edit (pencil), go to the Master Zone Configuration section, and on allow-update field, select DHCPUpdate-ACL and click on Save.

Similarly, for the reverse zone, click on edit (pencil), go to the Master Zone Configuration section, and on allow-update field, select DHCPUpdate-ACL and click on Save.

At this point, bind is ready to accept updates coming through using our specil dhcpupdate key. All we need is to make the DHCP Server reach bind with such key.

Go to Services >> DHCP Server and click on the tab that corresponds to the interface you want to configure bind9 dynamic hosts. Scroll down to Other Options and click on Show Advanced when you see the Dynamic Updates field:

  • Dynamic DNS
    • Enable registrations of DHCP client names in DNS: Checked
    • DDNS domain: lan.example.com
    • DDNS Hostnames: Checked
    • Primary DDNS address: 127.0.0.1
    • DNS Domain Key: dhcpupdate
    • Key Algorithm: HMAC-SHA256
    • DNS Domain key secret: rgZrbe9tzrI5GbL7weyaIY7f9AKbq0xc+76XuoS2muI=
      • No quotes, just the play string from the “secret” field
    • DDNS Client Updates: Ignore

Finally, click on Save and Apply. Now the DHCP Server will use the dhcpupdate key to send a DDNS update to bind9, which will use the same dhcpkey to authenticate the request.

Have fun!

Share this:

  • Tweet

Related

1 thought on “Configuring DHCP Dynamic Host registration on DNS Bind9 on your pfSense”

  1. Siemek says:
    March 27, 2024 at 9:39 AM

    Is i tpossible to configure it with Kea DHCP server?

    Reply

Leave a ReplyCancel reply

LIKED? SUPPORT IT :)

Buy Me a Coffee


Search


Categories

  • Cooking (1)
  • Homelab (79)
    • APC UPS (6)
    • pfSense (40)
    • Proxmox (20)
    • Shopping (1)
    • Supermicro (2)
    • Synology NAS (8)
    • Ubiquiti (6)
    • UDM-Pro (4)
  • Random (3)
  • Wordpress (1)

Tags

Agentless monitoring (3) AP9631 (3) Apache2 (3) APC UPS (6) Bind9 (3) certificates (5) crontab (2) DDNS (5) debian (3) DNS (7) DSM (6) DuckDNS (2) Dynamic DNS (4) en_US (2) Firewall (9) gmail (3) LDAP (2) Let's Encrypt Certificates (7) monitoring (18) networking (21) PBS (3) pfsense (43) port forwarding (3) proxmox (17) proxmox backup server (3) proxmox virtual environment (16) pve (5) rev202207eng (76) security (28) SNMP (4) SNMPv1 (3) ssh (4) SSL (6) subnet (2) Synology (7) udm-pro (5) unifi (6) unifi controller (3) unifi switch (2) UPS (5) VLAN (4) vpn (9) wifi (4) Zabbix (18) Zabbix Agent2 (11)

See also

Privacy policy

Sitemap

©2025 Geek is the Way! | Design by Superb