-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switching from ipv4ll to dhcp address loses nameserver (might be systemd bug) #330
Comments
As you guessed a systemd bug: systemd/systemd#25032 They ship a "resvolvconf compatbile" shim which turns out isn't compatible with all other implementations and refuse to fix it. |
Isn't systemd/systemd#25052 a fix? |
I have to echo https://github.com/systemd/systemd/pull/25052/files#r999176445 though. The resolvconf interface design seems unfortunate. |
It's unfortunate that he wants to map to a real interface as well. The original Debian init scripts had this in dnsmasq At the end of the day, it's just a label - and to ensure a unique key interface and protocol is the ideal combination. Now, the real question is why is 3) so damned important? Nothing in DNS is interface specific. Once you realise this, you know why simply extending the interface to interface[.protocol] was such a no-brainer at the time because other people came up with this approach and I copied the idea. |
I mean that ignores the fact that many sites have to use split horizon DNS, doesn't it? I think that's an (unfortunately necessary use-case) that has to be supported. |
People put too much into an interface. Heh. Anyway, split horizon is achieved using the source address of where the request came from, not which interface it came from which the DNS server cannot know. Likewise doing the reverse, we configure resolvers to send to specific nameservers for a domain via addressing and not via any interface. I'm not even sure that's technically possible either, but it's been a few years since I dug into this. |
Hi Roy,
I dont get what you're saying. So what if it's a bridge it's still an interface *shrug*. My workstation has a bridge br0 as it's main interface, so? I still want per-interface DNS request routing to work and I don't see how systemd-resolved could do that reliably without assigning meaning to the interfaces as far as resolvectl is concerned?
Look at it from the client side. One may want to ensure private DNS traffic doesn't end up at one's employers DNS server because of an always-on VPN just used to reach internal resources (say intranet.corp.domain) or conversely corp internal queries unencrypted to the ISP's DNS recursor. So it's not (mainly) a matter of the server figuring out where the request came from, but my machine routing the request to the right server in the first place (based on the advertised search domain(s)). There's this old systemd issue by Jason (wg author), I found it helpful to understand the use case. I think systemd/systemd#17529 is the one I'm thinking of.
I don't follow. How does addressing help here? |
Ubuntu 24.04 LTS. NetworkManager and netplan have been removed, using ifup instead. Since this box has a fixed location and the DNS servers will never change (Yeah, right!), I have just added my DNS servers to /etc/systemd/resolved.conf.d and turned off the nameserver option in dhcpcd.conf. That avoids the ipv4ll vs. dhcp confusion, although it does generate an extra message from resolvconf "No DNS servers specified, refusing operation" |
Routing is done from source address to target address. The kernel picks the interface to send the data out on based on this information. For example given this config:
Which interface do you think a lookup for thishost.deadbeef.org will go through?
This is achievable with openresolv + a decent resolver such as unbound. The -p marking will instruct openresolv to configure unbound to forward requests for *.corp.intranet to 10.1.1.1 Please note that the systemd resolvconf compat does not support -p, which is unfortunate.
I found it an interesting read. My opinion is this: The systemd-resolved interface design seems unfortunate. |
Maybe this is a new bug about resolvconf -d? The commit referenced only has test cases for the -a command.
Turn of the search and domain options as well. EDIT: Works as designed in you're allowed a domain and/or search domains without name servers in |
ifup an Ethernet interface (eno1) defined as dhcp. The dhcp server is slow so there is no response to the initial discovery. After a few seconds, dhcpcd drops down to ipv4ll and assigns a 169.254/16 address. dhcpcd drops into background and retries discovery which now works. That generates a call to add the new IP and nameservers (
dhcpcd-run-hooks BOUND
withif_down=false
) followed by a call to delete the ipv4ll address (dhcpcd-run-hooks IPV4LL
withif_down=true
). The first call sets the nameservers viaresolvconf -a eno1.dhcp
, the second call deletes the ipv4ll information withresolvconf -d eno1.ipv4ll -f
. Unfortunately systemd-resolvconf treats the second call asRevertLink
which wipes ALL information for eno1, resulting in no nameservers.Not sure if this is a dhcpcd bug (should it delete ipv4ll before adding dhcp data?) or a systemd-resolvconf bug (confusing
ipv4ll
withlink
).Workaround: add noipv4ll to /etc/dhcpcd.conf.
The text was updated successfully, but these errors were encountered: