Univention Bugzilla – Bug 46866
DNS configuration not working, when a DNS server is set via DHCP
Last modified: 2018-05-02 15:41:46 CEST
This problem occurred in the forum at https://help.univention.com/t/univention-domain-join-cli-fur-ubuntu-problem . The customer had installed an Ubuntu 16.04 and configured it's network via DHCP. The DHCP server was _not_ the domain controller master. The DHCP server transmitted a DNS server for the Ubuntu client. I suspect, that there is a problem with the DNS configuration, when the DNS sever has been set via DHCP.
We should try to reproduce the issue. Keep in mind that the customer is using an older version from the ppa. In my test last week with the ćurrent codebase, the issue did not ocur anymore.
As discussed, maybe this was due to ".local", so I've added a workaround for that via Bug #35981 Comment #33. But that is just a guess.
FYI: I had a very similar issue with Kubuntu 18.04 Beta 1 using the PPA for Ubuntu 16.04. The join was unable to resolve anything. AFAIR my workaround was to add the FQDN of the DC master to /etc/hosts on the client. The DHCP server was a UCS DC Backup. My guess back then was a problem with DNS on the Kubuntu Beta release, but this seems to be more generic.
Configuring via given master ip address does not work on 16.04, when another DNS server is configured manually. logfile: 2018-04-23 15:15:16,981 userinfo INFO Writing /etc/resolvconf/resolv.conf.d/base 2018-04-23 15:15:16,982 userinfo INFO Applying new resolvconf settings. 2018-04-23 15:15:17,407 userinfo CRITICAL Setting up DNS did not work. Try removing any DNS settings in the network-manager and give this tool the IP address of the DC master. 2018-04-23 15:15:17,408 userinfo CRITICAL Traceback (most recent call last): File "/usr/sbin/univention-domain-join", line 471, in run distribution_joiner.join_domain() File "/usr/lib/python2.7/dist-packages/univention_domain_join/distributions/ubuntu.py", line 95, in join_domain DnsConfigurator(self.nameservers, self.domain).configure_dns() File "/usr/lib/python2.7/dist-packages/univention_domain_join/join_steps/dns_configurator.py", line 75, in configure_dns self.check_if_dns_works() File "/usr/lib/python2.7/dist-packages/univention_domain_join/join_steps/dns_configurator.py", line 86, in check_if_dns_works raise DnsConfigurationException() DnsConfigurationException nameserver is written to /etc/resolvconf/resolv.conf.d/base but the settings are not appled.
Maybe a generic solution can be found that configures networkmanager directly and applies the settings permanently? In a short tests it worked to set nmcli con show --active NAME UUID TYP GERÄT Kabelnetzwerkverbindung 1 234b314d-6153-3236-a502-34f64ab6281a 802-3-ethernet eth0 nmcli con mod 234b314d-6153-3236-a502-34f64ab6281a ipv4.ignore-auto-dns "yes" ipv4.dns "10.200.29.71" nmcli con down 234b314d-6153-3236-a502-34f64ab6281a nmcli con up 234b314d-6153-3236-a502-34f64ab6281a
Also happening on ubuntu 14.04 with a different DNS server configured via DHCP and a valid ucs master ip address given in the gui. Same traceback i would like to be shown the error in the GUI that is only visible in the logfile : 2018-04-23 17:23:55,990 userinfo CRITICAL Setting up DNS did not work. Try removing any DNS settings in the network-manager and give this tool the IP address of the DC master.
> nameserver is written to /etc/resolvconf/resolv.conf.d/base but the settings are not applied. Yes, this resolvconf (shell script) stuff is not well documented and unfortunately doesn't work in the way the join client uses it. Additionally it's not usable reliably in combination with NetworkManager: * service resolvconf stop; service resolvconf start => new /etc/resolv.conf * service network-mamanger restart => old resolv.conf pointing to dnsmasq For 16.04 we should follow Comment 5. For 14.04 nm-cli doesn't support modification of DNS config. The only reliable way I found was to add "prepend domain-name-servers <IP>" (or even "supersede").
For ubuntu16.04 it worked in my scenarios: * manually configured nameserver was overwritten with the given master_ip, persistent after reboot * dhcp configured nameserver was overwritten with the given master_ip, persistent after reboot, ip address still via dhcp -> verified for 16.04
The current state for ubuntu 18.04 works but is not sufficient in my opinion. The join works, but after a reboot, any old DNS registered manually or via dhcp is still configured in networkmanager. This could lead to name resolution issues. The nameserver configured by the tool should be configured and be visible in network manager
Ok, I've adjusted dns_configurator.py to A) Use NetworkManager if the installed version of mncli > 1 B) Use a combination of editing 1) dhclient.conf, 2) networkmanager ini files and 3) adjusting the resolvconf templates. Case B) is only a fallback for 14.04. Updates pushed to git, new source packages generated, signed and uploaded to launchpad. Launchpad has successfully built the packages for bionic, artful, xenial and trusty.
OK: 18.04, 17.10, 16.04, 14.04 OK: Updates networkmanager config correctly OK: Available via ppa
Published as version 1.0-11: https://launchpad.net/~univention-dev/+archive/ubuntu/ppa