CU 203 Test : DNS does not update DHCP leases

I have a laptop that I use via Wi-Fi when mobile and via a wired connection at my desk.

The PC’s Windows hostname is “matebook”.

With CU202, the local Unbound DNS uses the REMARK field defined on the dhcp.cgi page for fixed leases.

The wired address is 192.168.20.49 with the name “huaweimb”.
The Wi-Fi address is 192.168.20.47 with the name “huaweimbW”.

When I query the DNS

PS C:\Users\phili> nslookup huaweimb
Server:   ipfire.pshome
Address:  192.168.20.1

Name:    huaweimb.pshome
Address:  192.168.20.49
PS C:\Users\phili> nslookup huaweimbW
Server:   ipfire.pshome
Address:  192.168.20.1

Name:    huaweimbW.pshome
Address:  192.168.20.47

With CU203, the local DNS uses the hostname provided by the Windows client.

When I connect to Wi-Fi, it assigns the address correctly.

Jul 10 21:58:04 ipfireSec dhcpd: execute_statement argv[0] = /usr/sbin/dhcp-lease
Jul 10 21:58:04 ipfireSec dhcpd: execute_statement argv[1] = commit
Jul 10 21:58:04 ipfireSec dhcpd: execute_statement argv[2] = ADDRESS=192.168.20.47
Jul 10 21:58:04 ipfireSec dhcpd: execute_statement argv[3] = HOSTNAME=matebook
Jul 10 21:58:04 ipfireSec dhcpd: execute_statement argv[4] = DOMAINNAME=pshome
C:\Users\phili> nslookup matebook
Serveur :   ipfiresec.pshome
Address:  192.168.20.1

Nom :    matebook.pshome
Address:  192.168.20.47

And nothing for huaweimbW

C:\Users\phili> nslookup huaweimbW
Server:   ipfireSec.pshome
Address:  192.168.20.1

*** ipfireSec.pshome can't find huaweimbW: Non-existent domain

If I connect via cable, the address 192.168.20.49 is indeed registered

Jul 10 22:04:55 ipfireSec dhcpd: execute_statement argv[0] = /usr/sbin/dhcp-lease
Jul 10 22:04:55 ipfireSec dhcpd: execute_statement argv[1] = commit
Jul 10 22:04:55 ipfireSec dhcpd: execute_statement argv[2] = ADDRESS=192.168.20.49
Jul 10 22:04:55 ipfireSec dhcpd: execute_statement argv[3] = HOSTNAME=matebook
Jul 10 22:04:55 ipfireSec dhcpd: execute_statement argv[4] = DOMAINNAME=pshome

but DNS still returns 192.168.20.47 for matebook

PS C:\Users\phili> nslookup matebook
Server:   ipfiresec.pshome
Address:  192.168.20.1

Name:    matebook.pshome
Address:  192.168.20.47

And nothing for huaweimb

C:\Users\phili> nslookup huaweimb
Server:   ipfireSec.pshome
Address: 192.168.20.1

*** ipfireSec.pshome cannot find huaweimb: Non-existent domain

So I lose the link to my laptop, my keyboard/mouse sharing software stops working.

According to the addressing provided, I understand that you have a bridge between green and blue?

Not at all.

I use a Wi-Fi access point on my Green network, and my laptop connects to that access point via Wi-Fi.
And when I connect it via cable, it is also on the Green network.
I have another access point on the Blue network with a different subnet and SSID.

Okay, I understand.
Connecting to Green via LAN and Wi-Fi gives you different IP addresses because you’re using different MAC addresses – that’s fine.
Both connections are handled by DHCP IPFire from the Green network; communication seems fine.
Static assignment in DHCP with different names seems to have nothing to do with DNS support.
Try connecting to your PC using the IP address instead of the name.

Of course I can access my PCs via their IP addresses; that’s not the problem.
If you’re reading the title of this post, then the DNS issue is exactly what I’m raising.

It is described here:

It’s essential to note that Unbound itself does not directly support RFC2136. As such, DNS registration is managed behind the scenes by the bridge script using a different method. Activating the DNS Update feature without redirecting updates to a different name server that supports RFC2136 will disable this capability.

I do not believe that RFC 2136 defines which hostname should be registered in the local DNS.

However, the way CU203 handles DNS for the local network is completely different from CU202.

I explained how CU202 works here.

Based on what I observed for CU203 regarding knot-resolver

At startup
1 - It loads the addresses defined in the /etc/hosts and /var/ipfire/main/hosts files into its local cache.

Then
When a host connects via DHCP, it adds its address and client hostname in other lease.db cache DNS and overwrites the address defined in hosts
The value of the REMARK field recorded in dhcp.cgi is ignored.

This bad “hostname - address” record persists in the cache (the cache is retained on disk even after a reboot).

My test:
A Windows PC named “virtual11” has two network cards.

Added fixed leases to the dhcp.cgi page.

00:0c:29:43:5e:24 	192.168.20.2 	virtual11
00:0c:29:43:5e:1a 	192.168.20.20 	virtual11Wifi

Adding records to the hosts.cgi page

192.168.20.2	virtual11			localdomain
192.168.20.20	virtual11Test		localdomain

At startup
I can see the addresses defined in the hosts file.

[root@ipfireTest ~]# nslookup virtual11
Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   virtual11.localdomain
Address: 192.168.20.2

[root@ipfireTest ~]# nslookup virtual11Test
Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   virtual11Test.localdomain
Address: 192.168.20.20

But not the one defined in DHCP.

[root@ipfireTest ~]# nslookup virtual11Wifi
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find virtual11Wifi: NXDOMAIN

When I connect to Wi-Fi

Jul 11 12:17:12 ipfireTest dhcpd: execute_statement argv[0] = /usr/sbin/dhcp-lease
Jul 11 12:17:12 ipfireTest dhcpd: execute_statement argv[1] = commit
Jul 11 12:17:12 ipfireTest dhcpd: execute_statement argv[2] = ADDRESS=192.168.20.20
Jul 11 12:17:12 ipfireTest dhcpd: execute_statement argv[3] = HOSTNAME=virtual11
Jul 11 12:17:12 ipfireTest dhcpd: execute_statement argv[4] = DOMAINNAME=localdomain
Jul 11 12:17:12 ipfireTest dhcpd: DHCPREQUEST for 192.168.20.20 (192.168.20.1) from 00:0c:29:43:5e:1a via green0
Jul 11 12:17:12 ipfireTest dhcpd: DHCPACK on 192.168.20.20 to 00:0c:29:43:5e:1a via green0

The name defined in the REMARK field of dns.cgi is ignored.

[root@ipfireTest ~]# nslookup virtual11Wifi
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find virtual11Wifi: NXDOMAIN

The address for virtual11 has changed. OK.

[root@ipfireTest ~]# nslookup virtual11
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   virtual11.localdomain
Address: 192.168.20.20

If I disconnect the Wi-Fi and plug in the wired connection…

Jul 11 12:20:47 ipfireTest dhcpd: execute_statement argv[0] = /usr/sbin/dhcp-lease
Jul 11 12:20:47 ipfireTest dhcpd: execute_statement argv[1] = commit
Jul 11 12:20:47 ipfireTest dhcpd: execute_statement argv[2] = ADDRESS=192.168.20.2
Jul 11 12:20:47 ipfireTest dhcpd: execute_statement argv[3] = HOSTNAME=virtual11
Jul 11 12:20:47 ipfireTest dhcpd: execute_statement argv[4] = DOMAINNAME=localdomain
Jul 11 12:20:47 ipfireTest dhcpd: DHCPREQUEST for 192.168.20.2 (192.168.20.1) from 00:0c:29:43:5e:24 via green0
Jul 11 12:20:47 ipfireTest dhcpd: DHCPACK on 192.168.20.2 to 00:0c:29:43:5e:24 via green0

DNS has retained the previous address and has not updated it to the new one for virtual11.

[root@ipfireTest ~]# nslookup virtual11
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   virtual11.localdomain
Address: 192.168.20.20

[root@ipfireTest ~]# nslookup virtual11Wifi
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find virtual11Wifi: NXDOMAIN

[root@ipfireTest ~]# nslookup virtual11Test
Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   virtual11Test.localdomain
Address: 192.168.20.20

And finaly
No longer able to access virtual11 by name

[root@ipfireTest ~]# ping virtual11
PING virtual11.localdomain (192.168.20.20) 56(84) bytes of data.
From ipfireTest.localdomain (192.168.20.1) icmp_seq=1 Destination Host Unreachable
From ipfireTest.localdomain (192.168.20.1) icmp_seq=2 Destination Host Unreachable
From ipfireTest.localdomain (192.168.20.1) icmp_seq=3 Destination Host Unreachable

Even after a reboot, this recording remains in the cache.

[root@ipfireTest ~]# nslookup virtual11
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   virtual11.localdomain
Address: 192.168.20.20

Even after clearing the cache

[root@ipfireTest ~]# kresctl cache clear
count: 1004

[root@ipfireTest ~]# nslookup virtual11
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   virtual11.localdomain
Address: 192.168.20.20

The fixed DHCP lease never expires
The only way I found to free up the address is to force release
/usr/sbin/dhcp-lease release ADDRESS=192.168.20.20 HOSTNAME=virtual11 DOMAINNAME=localdomain

And then
I locate the correct address (host)

[root@ipfireTest ~]# nslookup virtual11
Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   virtual11.localdomain
Address: 192.168.20.2

[root@ipfireTest ~]# ping virtual11
PING virtual11.localdomain (192.168.20.2) 56(84) bytes of data.
64 bytes from virtual11.localdomain (192.168.20.2): icmp_seq=1 ttl=128 time=0.437 ms
64 bytes from virtual11.localdomain (192.168.20.2): icmp_seq=2 ttl=128 time=0.493 ms
64 bytes from virtual11.localdomain (192.168.20.2): icmp_seq=3 ttl=128 time=0.805 ms

but I can’t run this command every time my PC changes its address !
I know, my explanations are always a bit long, but you have to take the time to read them to fully understand the problem.

Did you run the tests with the ‘Deny known clients’ option selected?

:thinking: I wonder whether switching it off will affect the results of your tests.

Regards

Thanks for the idea, but that doesn’t solve the problem; the leases.db database doesn’t update if the hostname already exists, so the address never changes.

Jul 11 16:17:28 ipfireTest dhcpd: execute_statement argv[0] = /usr/sbin/dhcp-lease
Jul 11 16:17:28 ipfireTest dhcpd: execute_statement argv[1] = commit
Jul 11 16:17:28 ipfireTest dhcpd: execute_statement argv[2] = ADDRESS=192.168.20.2
Jul 11 16:17:28 ipfireTest dhcpd: execute_statement argv[3] = HOSTNAME=virtual11
Jul 11 16:17:28 ipfireTest dhcpd: execute_statement argv[4] = DOMAINNAME=localdomain
Jul 11 16:17:28 ipfireTest dhcpd: DHCPREQUEST for 192.168.20.2 from 00:0c:29:43:5e:24 via green0
Jul 11 16:17:28 ipfireTest dhcpd: DHCPACK on 192.168.20.2 to 00:0c:29:43:5e:24 via green0

[root@ipfireTest ~]# nslookup virtual11
Server: 127.0.0.1
Address: 127.0.0.1#53

Name: virtual11.localdomain
Address: 192.168.20.20

[root@ipfireTest ~]# sqlite3 /var/lib/knot-resolver/leases.db
SQLite version 3.53.1 2026-05-05 10:34:17
Enter “.help” for usage hints.

sqlite> SELECT * FROM leases;
╭────────────────┬──────────────────────────╮
│    address     │         hostname         │
╞════════════════╪══════════════════════════╡
│ 192.168.10.203 │ windows11us.localdomain. │
│ 192.168.20.20  │ virtual11.localdomain.   │
╰────────────────┴──────────────────────────╯
sqlite>

windows11us is another VM connected to Blue for testing address changes for virtual11.

@pscar13 , have you looked into the source of dhcp-lease?
I think, the problem is that only conflicts for double addresses are handled ( a commit with a new name for a known address ). Your case is a commit transaction with a new address for a known name.

With your knowledge of sqlite3 it should be easy to check this with an modification to the file.
If my guess is true, don’t hesitate to send a bug to bugzilla.

Thanks @bbitsch

I noticed that the commit request is rejected when the host already exists.

My recent experiences with Bugzilla have not always been straightforward, and I have sometimes found it difficult to determine whether something should be considered a bug or simply the expected behavior.
From now on, I’ll just share the results of my testing and leave it to the developers to decide whether it warrants opening a bug report.

@pscar13

I agree and concur with your report.

I actually reported it myself https://community.ipfire.org/t/cu203-static-dhcp-entries-not-resolving/15906 but recieved no replies.

My setup was a simple Red, Green with no potential for duplicate addresses. Dynamic entries were resolved whereas static addresses were not.

Simply put this is either a regression from CU202 or is the new expected behaviour with the knot-resolver. If the latter to resolve static leases we need to add them to “Edit Hosts”

Like you I was reluctant to call things a bug when I wasn’t sure if it was just expected behaviour.

I have stopped my trial on IPFire due to other reasons so can’t contribute further.

On reflection, I realized that even updating the address for an existing hostname can still be problematic.

For example, many of my IoT devices identify themselves using generic hostnames like wlan0, and several of my cameras simply use camera as their hostname. In these cases, only the most recently connected device appears in the local DNS.

In some situations, I don’t need to access these devices via their hostname, but I do use the hostname to identify them within the local DNS.

For now, the only practical solution seems to be the one suggested by @rjackson: manually copying the static DHCP lease entries into hosts.cgi.

I will wait for the final release to see if this new behavior is retained.

If this change is intentional, it would be helpful to mention it in the release notes or documentation so that users understand this change in local DNS behavior.

Hi Phil,

This was and is my way of using IPFire since I started using it more than a decade ago.

And, each IP reserved has multiple names associated in hosts - names being generated by the services hosted there (samba, step-ca, cups / print, monit, ups, time), services consumed by some if not all machines (cups and certificate authority are consumed by all machines).

In my case the hosts file is the most important element in address resolution for my network - it allows clients to find the services available in the network.

I hope it helps.

Name resolution is a n → 1 relation, ideally a surjective relation ( if there is a name for all IPs ), between the sets of names and IPs.
This means, a function f: IP → name can not deliver unambigous results.

The update function initiated by DHCP to supply DNS with a new relation (name,IP) maybe incomplete. DHCP builds up a set of (MAC, IP) relations, the name of a device, identified by MAC, must not be known.

The task of defining a set of names for several services in the local network, is managed best in the host configuration. This information is determined outside the network by the admin, and it is hard if not impossible to resolve with DHCP informations only.

Hope this clarifications bring some light into this topic.

Thanks for explaining these rules, @bbitsch.

If I understand correctly, these are indeed the intended rules.

However, I previously pointed out that IPFire did not always behave in accordance with them:

With version CU202, depending on how static hosts, fixed DHCP leases, and the “REMARK” field were used, it was possible to end up with either multiple IP addresses for a single hostname or multiple hostnames for a single IP address.

Based on my tests, version CU203 might also lead to incorrect associations between hostnames and IP addresses, depending on the configuration used.

I also believe—based on the start of this discussion—that CU203 alters the behavior of local DNS management.

Thanks again to everyone for taking the time to explain and share this information.

Multiple IPs for the same name is not ‘standard’ behaviour. Usage in the DNS name space does this allow, for load balancing for example. But this construct demands several servers running the same time with the same offer.
Your case is a bit different. The same physical device operates in different sub networks. But the change isn’t handled fully. A device leaving a network regulated by DHCP can release its lease. Afterwards a new request for an IP of the other network can be done.
The ‘bridging SW’ realizes both operations: a request sends a (name, IP) definition to DNS, a release invalidates this association.

Windows does not do the release in every case.

In my case, the situation is slightly different.
The same physical device (Laptop) uses two network interfaces (Wi-Fi and Ethernet) on the SAME subnet.
Under Windows, when the Ethernet cable is plugged in, the Wi-Fi connection is disconnected automatically afterwards; there is no manual intervention.
During that transition, both IP addresses may temporarily be associated with the same hostname, which I believe is a valid situation.

I have observed the same behavior with Linux in some situations as well, particularly when DHCP Fixed Leases are used and all IOTs.

Contrary to what I previously wrote, after more thorough testing, migrating fixed DHCP leases to the hosts file does not solve my problem.
I have corrected my posts.

Thanks for your help.
Could you provide more details?
Which version of IPFire?
Are the IP addresses reserved in dhcp.cgi?
Are the hosts defined in hosts.cgi only?
Do all clients use the IPFire DNS to resolve the name of each service?
Have you tested CU203 with this configuration?