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 /etc/resolv.conf.

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

NetworkManager, through 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

In the GUI click on the network indicator, and select "Connection Information" from the menu. The upstream DNS resolvers are listed there.

| improve this answer | |

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 grep

For Ubuntu 14.04:

nmcli dev list iface eth0 | grep DNS

For Ubuntu 16.04:

nmcli dev show eth0 | grep DNS

Sources: respactive man nmcli pages and testing.

In both instances change eth0 to your interface name which may be different than mine

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.