I configured my machine with DHCP. Where can I find the IP addresses of the name servers?
The canonical location for the DNS resolvers on Linux is
Since NetworkManager has taken over from
ifconfig as the primary network management component, that file normally contains a single resolver, namely localhost:
$ cat /etc/resolv.conf ... nameserver 127.0.1.1
dnsmasq, provides this local DNS resolver.
dnsmasq is also the DHCP-client (and has various other roles), hence 'knows' the upstream DNS resolvers.
You can use
nmcli (the NetworkManager command-line interface) to query its settings:
$ nmcli dev show | grep DNS IP4.DNS: 10.103.0.24 IP4.DNS: 10.103.0.23
In the GUI click on the network indicator, and select "Connection Information" from the menu. The upstream DNS resolvers are listed there.
You can get pretty complete information on a network interface using
nmcli and you can narrow the output to the specific info you are looking for by piping it through
For Ubuntu 14.04:
nmcli dev list iface eth0 | grep DNS
For Ubuntu 16.04:
nmcli dev show eth0 | grep DNS
man nmcli pages and testing.
In both instances change eth0 to your interface name which may be different than mine