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.