[Kea-users] Kea 2.6.5: hosts-database with PostgreSQL not querying database during DHCP lease allocation
Darren Ankney
darren.ankney at gmail.com
Thu May 28 20:06:00 UTC 2026
Hi Eddy,
Never hurts to make sure. Peter had asked that earlier and I never
saw a response to that question. The logs you provided were not debug
logs and did not contain any of the host selection logic as they were
not debug logs. You can obtain debug logs for a short time period
(covering when a client arrived and did not receive their reserved IP)
by changing: `"severity": "INFO"` to `"severity": "DEBUG"` and adding
`"debuglevel": 99` in your loggers section. The debug logs covering
such a period should provide a complete record of IP address selection
for the client.
An additional note: I see that you have `"on-fail":
"serve-retry-continue",` in your hosts-database configuration. This
could result in Kea being unable to retrieve host information if it
loses connection to the database.
One last note: You don't need to load "libdhcp_pgsql_cb.so" to store
host reservations in the database. In Kea 3.0.3 you need to load
"libdhcp_pgsql.so" to have database support at all, but it is built
directly into kea-dhcp4 and kea-dhcp6 in Kea 2.6.5 (if enabled at
compile time). You would receive error messages in the case that
database support was absent and Kea would refuse to start (because of
your hosts-database section). "libdhcp_pgsql_cb.so" enables the
"configuration backend" (see here:
https://kea.readthedocs.io/en/kea-2.6.5/arm/dhcp4-srv.html#dhcp4-cb).
Thank you,
Darren Ankney
On Thu, May 21, 2026 at 10:25 AM Eddie Taylor <eddie.taylor at data443.com> wrote:
>
> Thanks Darren! We do have hosts-database configured with PostgreSQL with something like you have below and a bit more data and both host_cmds and pgsql_cb hooks loaded. Logs show the database opens successfully at startup. But DHCP clients still receive pool IPs instead of database-reserved IPs. What else might be missing to enable database host reservation queries during lease assignment?
>
> Ask if there's a specific parameter or hook configuration needed, or if this might be a Kea 2.6.5 limitation with database hosts in HA load-balancing mode.
>
> see below
>
> hosts-database": {
> "type": "postgresql",
> "host": "10.40.31.7",
> "port": 5000,
> "name": "kea",
> "user": "kea",
> "password": can't show here lol
> "on-fail": "serve-retry-continue",
> "retry-on-startup": true,
> "max-reconnect-tries": 10,
> "reconnect-wait-time": 3000
> }
>
>
> -----Original Message-----
> From: Kea-users <kea-users-bounces at lists.isc.org> On Behalf Of Darren Ankney
> Sent: Thursday, May 21, 2026 9:04 AM
> To: Kea user's list <kea-users at lists.isc.org>
> Subject: Re: [Kea-users] Kea 2.6.5: hosts-database with PostgreSQL not querying database during DHCP lease allocation
>
> > Config-file reservations work, database ones don't
>
> Hi Eddie,
>
> Please check if you have in your configuration the hosts-database section as described here:
> https://kea.readthedocs.io/en/kea-2.6.5/arm/dhcp4-srv.html#hosts-storage
> It might look something like this:
>
> "hosts-database": {
> "type": "mysql",
> "name": "kea",
> "user": "kea",
> "password": "secret123",
> "host": "localhost",
> "port": 3306
> }
>
> merely loading the host_cmds hook is not enough to enable storage of host reservations in the database.
>
> Thank you,
> Darren Ankney
>
> On Wed, May 20, 2026 at 9:24 PM Eddie Taylor <eddie.taylor at data443.com> wrote:
> >
> >
> > Attacheced are logs
> >
> > Environment:
> >
> > Kea 2.6.5 (stable)
> > 3-server HA cluster (load-balancing mode) PowerDNS servers:
> > 10.40.31.1, 10.40.31.2, 10.40.31.3 PostgreSQL backend: 10.40.31.7:5000
> > via PgBouncer Database schema: 22.2
> > Configuration:
> >
> > hosts-database configured on all 3 servers with PostgreSQL connection
> > details All required hooks loaded: libdhcp_host_cmds.so,
> > libdhcp_lease_cmds.so, libdhcp_ha.so, libdhcp_pgsql_cb.so HA is
> > healthy and working correctly
> >
> >
> > Kea version: 2.6.5
> > Hook: libdhcp_pgsql_cb.so loading successfully
> > Database: PostgreSQL hosts database opening at startup
> > Reproduction: VM MAC bc:24:11:43:b0:19 configured with reserved IP
> > 10.40.3.185 in database, but receives pool IP 10.40.3.164 on DHCP
> > lease request Config-file reservations work, database ones don't Logs
> > showing successful pgsql_cb initialization
> >
> > This appears to be either:
> >
> > A bug in Kea 2.6.5 pgsql_cb integration Missing configuration
> > parameter Or unsupported feature in this version
> >
> >
> > -----Original Message-----
> > From: Kea-users <kea-users-bounces at lists.isc.org> On Behalf Of Doug
> > Freed
> > Sent: Tuesday, May 12, 2026 6:02 PM
> > To: kea-users at lists.isc.org
> > Subject: Re: [Kea-users] Kea 2.6.5: hosts-database with PostgreSQL not
> > querying database during DHCP lease allocation
> >
> > On 5/12/26 15:03, Eddie Taylor wrote:
> > > Sorry for the delay had an issue to address.
> > >
> > > root at p-powerdns-001 ~]# grep -A 100 '"hooks-libraries"'
> > > /etc/kea/kea- dhcp4.conf | grep -A 1 "library"
> > >
> > > "library": "/usr/lib64/kea/hooks/libdhcp_lease_cmds.so"
> > >
> > > },
> > >
> > > --
> > >
> > > "library": "/usr/lib64/kea/hooks/libdhcp_ha.so",
> > >
> > > "parameters": {
> > >
> > > --
> > >
> > > "library": "/usr/lib64/kea/hooks/libdhcp_host_cmds.so"
> > >
> > > },
> > >
> > > --
> > >
> > > "library": "/usr/lib64/kea/hooks/libdhcp_pgsql_cb.so"
> > >
> > > }
> > >
> > > [root at p-powerdns-001 ~]#
> > >
> > > *From:*Kea-users <kea-users-bounces at lists.isc.org> *On Behalf Of
> > > *Peter Davies
> > > *Sent:* Tuesday, May 12, 2026 11:47 AM
> > > *To:* kea-users at lists.isc.org
> > > *Subject:* Re: [Kea-users] Kea 2.6.5: hosts-database with PostgreSQL
> > > not querying database during DHCP lease allocation
> > >
> > > Hi Eddie,
> > > What does your "hosts-database" definition look like?
> > >
> > > Have you remembered to load the host commands hooks library
> > > "libdhcp_host_cmds.so"
> > >
> > > See: https://kea.readthedocs.io/en/kea-2.6.5/arm/hooks.html#libdhcp-
> > > host-cmds-so-host-commands
> > > <https://kea.readthedocs.io/en/kea-2.6.5/arm/
> > > hooks.html#libdhcp-host-cmds-so-host-commands>
> > >
> > > /Peter
> > >
> > > On 12/05/2026 17.25, Eddie Taylor wrote:
> > >
> > > According to kb.isc.org/docs/aa-01615 (Kea Significant Features
> > > Matrix), Kea 2.6 should support Host Reservations Mode (Global). We
> > > have hosts-database configured with PostgreSQL, the schema is
> > > correct (22.2), host reservations exist in the database with correct
> > > data, but Kea 2.6.5 is not querying the database during DHCP lease
> > > assignment. No special hook is indicated as required for Kea 2.6
> > > host reservations in the matrix. What's missing or broken?
> > >
> > > All email and communication should be considered private and
> > > protected personal and shall be secured under all applicable laws.
> > > Any recipient, who has access to any contained information,
> > > regardless of purpose or medium is so advised, bound and obligated
> > > to handle as such.
> > >
> > > --
> > >
> > > Peter Davies
> > >
> > > Support Engineer
> > >
> > > Internet Systems Corporation
> > >
> > > All email and communication should be considered private and
> > > protected personal and shall be secured under all applicable laws.
> > > Any recipient, who has access to any contained information,
> > > regardless of purpose or medium is so advised, bound and obligated to handle as such.
> > >
> >
> > My first recommendation would be to crank the logging up to DEBUG level 99, and trigger some clients to request a lease that should be getting a reservation. Post the logs here on the list and somebody can probably figure out what's going wrong. It would likely also be helpful to have your full configuration.
> >
> > -Doug
> > --
> > ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
> >
> > To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
> > Kea-users at lists.isc.org
> > All email and communication should be considered private and protected personal and shall be secured under all applicable laws. Any recipient, who has access to any contained information, regardless of purpose or medium is so advised, bound and obligated to handle as such.
> > --
> > ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
> >
> > To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
> > Kea-users at lists.isc.org
> --
> ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
>
> To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
> Kea-users at lists.isc.org
> All email and communication should be considered private and protected personal and shall be secured under all applicable laws. Any recipient, who has access to any contained information, regardless of purpose or medium is so advised, bound and obligated to handle as such.
> --
> ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
>
> To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
> Kea-users at lists.isc.org
More information about the Kea-users
mailing list