Bug 46866 - DNS configuration not working, when a DNS server is set via DHCP
DNS configuration not working, when a DNS server is set via DHCP
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Univention Domain Join (Ubuntu)
UCS 4.3
Other Linux
: P5 normal (vote)
: UCS 4.3-0-errata
Assigned To: Arvid Requate
Richard Ulmer
:
Depends on: 35981 46737
Blocks:
  Show dependency treegraph
 
Reported: 2018-04-23 11:16 CEST by Richard Ulmer
Modified: 2018-05-02 15:41 CEST (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Ulmer univentionstaff 2018-04-23 11:16:49 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.
Comment 1 Erik Damrose univentionstaff 2018-04-23 11:20:29 CEST
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.
Comment 2 Arvid Requate univentionstaff 2018-04-23 14:24:42 CEST
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.
Comment 3 Ingo Steuwer univentionstaff 2018-04-23 15:39:06 CEST
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.
Comment 4 Erik Damrose univentionstaff 2018-04-23 16:08:58 CEST
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.
Comment 5 Erik Damrose univentionstaff 2018-04-23 16:11:54 CEST
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
Comment 6 Erik Damrose univentionstaff 2018-04-23 17:26:42 CEST
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.
Comment 7 Arvid Requate univentionstaff 2018-04-24 12:24:01 CEST
> 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").
Comment 8 Erik Damrose univentionstaff 2018-04-24 16:07:22 CEST
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
Comment 9 Erik Damrose univentionstaff 2018-04-24 18:07:31 CEST
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
Comment 10 Arvid Requate univentionstaff 2018-04-25 17:17:38 CEST
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.
Comment 11 Erik Damrose univentionstaff 2018-04-25 17:23:11 CEST
OK: 18.04, 17.10, 16.04, 14.04
OK: Updates networkmanager config correctly
OK: Available via ppa
Comment 12 Arvid Requate univentionstaff 2018-05-02 15:41:46 CEST
Published as version 1.0-11:
 https://launchpad.net/~univention-dev/+archive/ubuntu/ppa