Univention Bugzilla – Bug 53679
DHCP DNS vs. profile vs. UCR
Last modified: 2023-10-26 12:03:42 CEST
4.4: base/univention-network-manager/etc/dhcp/dhclient-exit-hooks.d/resolvconf 5.0: base/univention-network-manager/etc/dhcp/dhclient-enter-hooks.d/resolvconf both contain the logic to handle the DNS server provided via DHCP. The logic basically is: - if the server is a joined DC, copy to UCRV "dns/forwarder[123]" - otherwise write it to /etc/resolv.conf - since 5.0 via UCRV "nameserver[123]" Each time the DHCP release is renewed, the code gets re-executed and does the wrong things, as it only used "/var/univention-join/joined" as an indicator. This flag file is created at the *start*, not when the local BIND is provisioned and *functional*. This leads to a broken DNS setup in several cases. - test/utils/utils.sh:basic_setup() copies the AmazonProvidedDNS into both "nameserver[123]" and "dns/forwarder[123]" - test/utils/utils.sh:run_setup_join_on_non_master() copies the DNS server set in the profile to "nameserver1" - test/utils/utils.sh:basic_setup_ucs_role() and basic_setup_ucs_joined() set the given DNS server as "nameserver1" - services/univention-bind/90univention-bind-post.inst calls `/usr/share/univention-server/univention-fix-ucr-dns --force-self` to set "nameserver1" - U@S requires DNS to use localhost for further provisioning: the U@S packages are installed *before* the school server is joined, so their code is already executed *during* join. The regular code therefore must be able to update the DNS configuration at that point. We have tried to fix this multiple times by now, but nothing worked so far reliably for all cases: - using `ucr set --focred` breaks U@S, which expects the configuration to changed during join. - `nameserver/external` has different semantics between UCS-4 and UCS-5 and must be set to `false` 1. base/univention-network-manager/etc/dhcp/dhclient-{enter,exit}-hooks.d/resolvconf should base its decision on BIND being provisioned and functional instead of /var/univention-join/joined 2. utils/utils.sh sets UCRV nameserver1 in several cases - DHCP should not overwrite this while the join is running