Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My /etc/resolv.conf looks like this:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

# OpenDNS Fallback (configured by Linux Mint in /etc/resolvconf/resolv.conf.d/tail).

When I use nslookup, I seem to use

moose@pc08 ~ $ nslookup

Non-authoritative answer:

But when I right-click on network manager and click on "connection information" I get:

connection information

whois reveals that this belongs to Deutsche Telekom AG, my ISP.

Why does network manager show this information? What DNS server am I currently using?


Yes, I seem to run dnsmasq:

moose@pc08 ~ $ ps aux | grep dnsmasq
nobody    1479  0.0  0.0   5468  1404 ?        S    14:16   0:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/sendsigs.omit.d/ --listen-address= --conf-file=/var/run/nm-dns-dnsmasq.conf --cache-size=0 --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
share|improve this question
possible duplicate of Command-line to list DNS servers – krlmlr Apr 9 '15 at 13:07
up vote 16 down vote accepted

You are using dnsmasq, a lightweight forwarding DNS server that runs locally under the control of NetworkManager. Dnsmasq forwards DNS queries to the DNS servers whose addresses have been provided by the DHCP server. It is also possible to set these DNS server addresses statically using the Connection Editor.

The dnsmasq executable is provided by the dnsmasq-base package on which the network-manager package depends. There is also a package called simply "dnsmasq" which also depends on dnsmasq-base, but this "dnsmasq" package should only be installed if you want to run dnsmasq independently of NetworkManager in order to take advantage of features other than mere DNS forwarding.

share|improve this answer
@jdthood - your changes are quite extensive and could be construed to go beyond the OP's intent. Please create your own answer if required to support your thoughts. Thanks. – fossfreedom Mar 26 '13 at 13:54
@jdthood: I do appreciate your effort to ensure a correct answer. It is however my understanding that the default behavior of dnsmasq, as integrated with NetworkManager, is to cache 150 entries in accordance with their respective TTL settings. – Roy Mar 26 '13 at 13:58
By default NM-dnsmasq's cache is disabled. Do ps -ef|grep dnsmasq and look for the option --cache-size=0. – jdthood Mar 26 '13 at 14:17
That's not the case on my 12.04 box, but a google search shows that you are right, that is the default on both 12.04 and 12.10. So, a caching DNS server with caching disabled then :) – Roy Mar 26 '13 at 15:49
dnsmasq appears to be using the closest dns server(i.e., the one it can reach fastest), if you specify two or more in your settings. Which makes sense from (providing faster) user experience point of view. Plus, the resolv.conf file mentioned the other, OpenDNS as fallback, not primary, right ? – Serg Jan 6 '15 at 11:37

As en expansion of happyskeptic's answer, you don't need to specify an interface. This does it for me:

> nmcli dev list | grep DNS
IP6.DNS[1]:                             2a01:4f0:400c:1::1
share|improve this answer
My Ubuntu 16 system wants nmcli dev show – nortally Apr 6 at 23:14

I've found that on Kubuntu 14.04 the NetworkManager applet (or Plasma thing, whatever it's called) in KDE doesn't show the DNS server info under the connection details.

In this case the way to find it is to run the following at the command line and look for the lines 'IP4.DNS':

nmcli dev list iface wlan0

(replace wlan0 with the interface you use to connect to the Net)

share|improve this answer
Great! It will help me when the DNS disappears... – karatedog Sep 4 '15 at 10:21
nmcli device show wlan0 in my case – Searene Oct 7 '15 at 2:23

You're using the if both your primary and secondary DNS are not found, it'll go to your router and use the DNS server configured in the router. If that DNS fails as well, it'll probabely try to connect to the openDNS server. as configured in /etc/resolv.conf.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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