Bug 13843 - unbound : Local DNS contain two IP adresses for the same host
Summary: unbound : Local DNS contain two IP adresses for the same host
Status: CLOSED NOTABUG
Alias: None
Product: IPFire
Classification: Unclassified
Component: --- (show other bugs)
Version: 2
Hardware: unspecified All
: - Unknown - Minor Usability
Assignee: Assigned to nobody - feel free to grab it and work on it
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-27 12:39 UTC by Phil SCAR
Modified: 2025-04-29 09:29 UTC (History)
3 users (show)

See Also:


Attachments
patch proposed (698 bytes, patch)
2025-04-28 10:25 UTC, Phil SCAR
Details | Diff
new patch file (517 bytes, patch)
2025-04-28 11:27 UTC, Phil SCAR
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Phil SCAR 2025-04-27 12:39:22 UTC
I’m not familiar with all the management rules coded in /usr/sbin/unbound-dhcp-leases-bridge, but they seem consistent.

The hosts file must contain only static IP addresses (not using DHCP).

The fixleases file must contain the IP addresses to be assigned by DHCP when the client connects.

The local DNS records static IP addresses.

The local DNS records IP addresses assigned by DHCP (fixed or dynamic).

However, I don’t know the rule that defines the host name, and whether it should be assigned by the client or the DHCP server.

For IPFire (in this version 193):

The DHCP server defines the hostname if it is present in fixleases; otherwise, it uses the client’s hostname.
This is consistent, but this last rule doesn’t work if the address is previously defined as static.

In this case it records both, fixlease name and client_name, the Local DNS contains two hostnames for the same IP address

if I plug my laptop into a fixed connection via USB (to use the 2.5Gb), the Wi-Fi is disabled, but the DNS retains both addresses for the same client-name
See
https://community.ipfire.org/t/local-dns-not-reliable/13942/50?u=pscar13

https://community.ipfire.org/t/local-dns-not-reliable/13942/60?u=pscar13

I don’t see why IPFire
Doesn’t register an IP/client-name in the Local DNS if it’s already present in fixleases (log message “Won't update fixed lease”
But registers this IP/client-name if it’s present in both fixleases and hosts

Its probably a bug
Comment 1 Phil SCAR 2025-04-27 17:05:32 UTC
I found a workaround by deleting the records in the hosts file that have fixed leases.

But it might be useful to avoid this use case.
Comment 2 Phil SCAR 2025-04-28 10:25:17 UTC
Created attachment 1638 [details]
patch proposed

I propose this patch, it adds the fixed leases which are already in host
Comment 3 Phil SCAR 2025-04-28 11:27:04 UTC
Created attachment 1639 [details]
new patch file

or more simply
Comment 4 Phil SCAR 2025-04-28 11:58:06 UTC
But I'll also add a rule to the documentation:

"Do not define a host in Static Hosts if it is already defined in DHCP Fixed Leases:
- Clients with a static address must be defined in the hosts file
- Clients using DHCP to obtain a fixed address must be declared in DHCP Fixed Leases"
Comment 5 Adolf Belka 2025-04-28 12:49:49 UTC
(In reply to Phil SCAR from comment #4)
> But I'll also add a rule to the documentation:
> 
> "Do not define a host in Static Hosts if it is already defined in DHCP Fixed
> Leases:
> - Clients with a static address must be defined in the hosts file
> - Clients using DHCP to obtain a fixed address must be declared in DHCP
> Fixed Leases"

I would be careful about adding that to the documentation. It should be more about if you get the issue you have described then your suggestion is an approach that might work to solve it but not a blanket don't define a host in the Hosts page if it is in the DHCP Fixed Leases list. I would not support a blanket comment such as that in the documentation.

I don't have to use your approach at all. All of my hosts are in both DHCP Fixed Leases and in the Hosts page and I don't experience the same IP with two hosts names.

I believe this might be because you are using a windows laptop and the windows dhcp client doesn't work the same as Linux dhcp clients.
Comment 6 Phil SCAR 2025-04-28 14:34:58 UTC
(In reply to Adolf Belka from comment #5)
> (In reply to Phil SCAR from comment #4)
> > But I'll also add a rule to the documentation:
> > 
> > "Do not define a host in Static Hosts if it is already defined in DHCP Fixed
> > Leases:
> > - Clients with a static address must be defined in the hosts file
> > - Clients using DHCP to obtain a fixed address must be declared in DHCP
> > Fixed Leases"
> 
> I would be careful about adding that to the documentation. It should be more
> about if you get the issue you have described then your suggestion is an
> approach that might work to solve it but not a blanket don't define a host
> in the Hosts page if it is in the DHCP Fixed Leases list. I would not
> support a blanket comment such as that in the documentation.
> 
> I don't have to use your approach at all. All of my hosts are in both DHCP
> Fixed Leases and in the Hosts page and I don't experience the same IP with
> two hosts names.
> 
> I believe this might be because you are using a windows laptop and the
> windows dhcp client doesn't work the same as Linux dhcp clients.

Thank you.

You've already made this point on the forum.

I have two comments on your point of view, but I don't know if I should make them here.

- How would this rule change the operation of your network? Or of other users?
- If you're not using Windows, you can't answer for all users, but I assume you have test sets with Windows machines.

In any case:
- If you declare static addresses in hosts, they are loaded into /etc/unbound/hosts.conf
- If you declare fixed leases in DHCP, they must be loaded into /etc/unbound/dhcp-leases.conf

If you declare both a static address and a fixed lease, they must be loaded into both.

This makes sense to me.

This is the purpose of my patch.

Perhaps you should discuss this with your development teams; there may be Windows users.

But I understand that you are the one who makes the decision.

And I will respect it.
Comment 7 Phil SCAR 2025-04-28 19:20:16 UTC
The problem isn't limited to Windows.

It's the same with Linux!

https://community.ipfire.org/t/local-dns-not-reliable/13942/84?u=pscar13
Comment 8 Michael Tremer 2025-04-29 09:08:42 UTC
Good morning people,

first of all a couple of ground rules.

(In reply to Phil SCAR from comment #6)
> Perhaps you should discuss this with your development teams; there may be
> Windows users.
> 
> But I understand that you are the one who makes the decision.
> 
> And I will respect it.

I don't appreciate any of this "take it of leave it" in the conversation.

This bug report is incredibly vage and not clear at all what actually is supposed to be the problem here. I am going to outright ignore everything that was said on the forum because that is pages full of guessing, making up facts and not a single person ever looked at the documentation or an RFC.

You also are sending a patch and it is not clear to me what that is actually going to fix. So please explain clearly what the actual problem is. Or should I have a guess?

Is it simply that DNS is not being updated in case you have a fixed lease?

(In reply to Phil SCAR from comment #4)
> But I'll also add a rule to the documentation:
> 
> "Do not define a host in Static Hosts if it is already defined in DHCP Fixed
> Leases:
> - Clients with a static address must be defined in the hosts file
> - Clients using DHCP to obtain a fixed address must be declared in DHCP
> Fixed Leases"

There is no relationship between the two things you are saying.

Please explain it to me like I am five.
Comment 9 Michael Tremer 2025-04-29 09:29:09 UTC
So there is no bug here then...