Ubuntu – Using networkd, how to see DNS Server


So the Ubuntu server is configured with netplan and the renderer is: networkd.

How does one see the active DNS Server ? i.e. there is no NetworkManager.

Best Answer

When using netplan (17.10 Artful Ardvark on) and the renderer is: networkd, there is no NetworkManager so the nmcli commands do not apply. The cat /etc/resolv.conf simply shows the nameserver to be, not very helpful really ;-)

To get the nameservers.

ubuntu@ub-17-10:~$ systemd-resolve --status | sed -n '/DNS Servers/,/^$/p'
         DNS Servers:
          DNS Domain: netlabsug.tst