I have recently set up a Windows AD domain controller with DNS and DHCP servers. Windows clients get their DNS server set to match what DHCP hands out but my Ubuntu 16.04 workstation only sets the loopback address and a search domain:
I had expected to see the setting nameserver 192.168.14.4 in /etc/resolveconf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search pdf-xchange.net
If I add dns-nameservers 192.168.14.4 to /etc/network/interfaces , i see it in /etc/resolv.conf but i want some Ubuntu Desktops to use DHCP and not have to manually modify them.
Why does a DHCP client not add the DNS nameserver the way a static entry in /etc/network/interfaces does ? I want this set as it is specified as a prerequisite for adding the machine to the AD domain:
The domain controller is the primary DNS resolver as specified in /etc/resolv.conf.
https://help.ubuntu.com/lts/serverguide/sssd-ad.html.en-GB#sssd-ad-requirements
The documentation is wrong here, or let's say not very exact. On a standard 16.04 workstation installation you will get what you see, resolv.conf pointing to localhost. An instance of dnsmasq running on port 53 will handle the DNS requests. The reasons for this are beyond this question.
Anyway you can list the DNS servers in use, as configured by network-manager, by running the following command:
For the sake of completeness, a command like the following would need to be used on a normal 18.04 installation: