You are not logged in.
Hi!
dhclient updates /etc/resolv.conf when a new lease is obtained (this is something needed as otherwise name resolution won't work).
However, when the resolvconf is installed and there are other active 'providers' of DNS servers names (like openconnect vpnc-script), dhclient continues to mess (during every lease update) with the resolv.conf contents, overwriting it directly.
The solution is pretty easy - switch dhclient to resolvconf usage:
--- /tmp/dhclient-script_make_resolv_conf 2021-03-29 18:57:40.501698266 +0200
+++ /etc/dhclient-enter-hooks 2021-03-29 17:45:40.048533479 +0200
@@ -37,11 +39,9 @@
sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf
fi
- if [ -f /etc/resolv.conf ]; then
- chown --reference=/etc/resolv.conf $new_resolv_conf
- chmod --reference=/etc/resolv.conf $new_resolv_conf
- fi
- mv -f $new_resolv_conf /etc/resolv.conf
+ cat $new_resolv_conf | /usr/bin/resolvconf -a $interface
+ rm $new_resolv_conf
+
# DHCPv6
elif [ -n "$new_dhcp6_domain_search" ] || [ -n "$new_dhcp6_name_servers" ]; then
new_resolv_conf=/etc/resolv.conf.dhclient-new
and a clean-up part in /etc/dhclient-exit-hooks
case "$reason" in
EXPIRE|FAIL|RELEASE|STOP)
/usr/bin/resolvconf -d $interface
;;
esac
This works fine for me - I have both vpn and isp nameservers in the /etc/resolv.conf and they all update automatically.
Should this be fixed somewhere globally? Not sure where exactly - in dhclient repo? or in the arch package? resolvconf detection should be added, of course, to preserve the original behaviour.
Thanks.
Last edited by one_half_3544 (2021-04-23 11:05:16)
Offline
dhclient is part of the ISC dhcp package. ISC is switching to a new dhcp server, kea but that one doesn't have a dhcp client .
ISC DHCP is an open source solution for DHCP servers, relay agents, and clients, both IPv4 and IPv6. Please note that this project is in maintenance mode - we are not actively adding new functionality and may not respond to non-critical issues.
Looks like adding resolvconf support would be simplest through a patch to the archlinux dhcp / dhclient package.
Last edited by Lone_Wolf (2021-04-23 11:43:36)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
ok, I'll prepare a clean patch. How should it be submitted? Via a bug report in https://bugs.archlinux.org/?project=1&string=dhclient ?
Thanks.
Offline
Patching in features isn't something Arch does in most cases. Why not just switch to a client that supports resolvconf?
The patch also makes resolvconf a hard dep, I doubt that would be accepted anywhere.
Last edited by Scimmia (2021-04-23 12:26:52)
Offline
Patching in features isn't something Arch does in most cases. Why not just switch to a client that supports resolvconf?
Not adding features is reasonable, but since both dhclient and openconnect packages come from the arch-linux repo, the fact they don't play nice together is still technically a bug, not a missing functionality, isn't it?
Having said that, which dhcp client suports resolvconf? (I just don't know. And, trying to keep things minimal, just chose the smallest version).
The patch also makes resolvconf a hard dep, I doubt that would be accepted anywhere.
As mentioned before, adding [ -f /usr/bin/resolvonf ] (or what would be the proper way to detect the package presence? ) is not a problem.
Last edited by one_half_3544 (2021-04-23 12:50:15)
Offline
Having said that, which dhcp client suports resolvconf? (I just don't know. And, trying to keep things minimal, just chose the smallest version).
Depends on exactly what you're doing with it. If you just need a standalone dhcp client, dhcpcd comes to mind.
Offline
https://gitlab.isc.org/isc-projects/dhc … &state=all
what would be the proper way to detect the package presence
Online
Ok, they have declined the idea - https://gitlab.isc.org/isc-projects/dhcp/-/issues/194.
So, again, how about adding this patch to the archlinux package? (modified to detect openresolv presence and use old the behaviour if it is not there, of course).
Offline
I suggest you contact the archlinux dev who maintains the dhpc / dhclient package (Christian Hesse aka eworm) through mailing list, personal email, irc, matrix etc to see if he's willing to add this.
Incase he's not, I think a package with this change is eligible for AUR since it adds functionality not presesnt in the repo package.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Ok, they have declined the idea - https://gitlab.isc.org/isc-projects/dhcp/-/issues/194.
So, again, how about adding this patch to the archlinux package? (modified to detect openresolv presence and use old the behaviour if it is not there, of course).
Already covered in post #4. Patching in non-upstream features is pretty much a no-go.
Offline