What is my DNS server?

49,454

Solution 1

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.

Solution 2

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

> nmcli dev show | grep DNS
IP4.DNS[1]:                             172.22.216.251
IP6.DNS[1]:                             2a01:4f0:400c:1::1

For Ubuntu 14.04 and older use nmcli dev list | grep DNS

> nmcli dev list | grep DNS
IP4.DNS[1]:                             172.22.216.251
IP6.DNS[1]:                             2a01:4f0:400c:1::1

Solution 3

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)

Solution 4

You're using the 217.0.43.129. 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.

https://lists.isc.org/pipermail/bind-users/2006-October/064570.html

Share:
49,454

Related videos on Youtube

Martin Thoma
Author by

Martin Thoma

I also have a blog about Code, the Web and Cyberculture and a career profile on Stackoverflow. My interests are mainly machine-learning, neural-networks, data-analysis.

Updated on September 18, 2022

Comments

  • Martin Thoma
    Martin Thoma almost 2 years

    My /etc/resolv.conf looks like this:

    # 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
    
    # OpenDNS Fallback (configured by Linux Mint in /etc/resolvconf/resolv.conf.d/tail).
    nameserver 208.67.222.222
    nameserver 208.67.220.220   
    

    When I use nslookup, I seem to use 127.0.1.1:

    moose@pc08 ~ $ nslookup www.google.com
    Server:     127.0.1.1
    Address:    127.0.1.1#53
    
    Non-authoritative answer:
    Name:   www.google.com
    Address: 173.194.44.17
    Name:   www.google.com
    Address: 173.194.44.16
    Name:   www.google.com
    Address: 173.194.44.19
    Name:   www.google.com
    Address: 173.194.44.18
    Name:   www.google.com
    Address: 173.194.44.20
    

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

    connection information

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

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

    dnsmasq

    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/network-manager.dnsmasq.pid --listen-address=127.0.1.1 --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
    
  • nilsonneto
    nilsonneto over 11 years
    @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.
  • Roy
    Roy over 11 years
    @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.
  • jdthood
    jdthood over 11 years
    By default NM-dnsmasq's cache is disabled. Do ps -ef|grep dnsmasq and look for the option --cache-size=0.
  • Roy
    Roy over 11 years
    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 :)
  • Sergiy Kolodyazhnyy
    Sergiy Kolodyazhnyy over 9 years
    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 ?
  • user1232105
    user1232105 almost 9 years
    Great! It will help me when the DNS disappears...
  • Roy
    Roy almost 9 years
    @karatedog You can easily configure dnsmasq to only ask specific DNS servers for hosts under a given domain or subdomain. Internal hosts are a very typical use case.
  • Sk4ry
    Sk4ry over 8 years
    nmcli device show wlan0 in my case
  • nortally
    nortally about 8 years
    My Ubuntu 16 system wants nmcli dev show
  • Sergiy Kolodyazhnyy
    Sergiy Kolodyazhnyy over 7 years
    That's because nmcli version has been changed in since Ubuntu 15.04 due to transition to different init system, so yes, in newer releases the command is just slightly different
  • Peter V. Mørch
    Peter V. Mørch over 7 years
    When I'm logged in to my work network using NetworkManager and VPNC, I don't see my work's DNS server in this output, even though clearly it is resolving. I don't (yet) know how to see the VPN DNS server.
  • Alexander Skwar
    Alexander Skwar over 7 years
    To make dnsmasq show the DNS that it's using, one can send it the USR1 signal and it'll then dump stats and such to syslog. So, do: tail -F /var/log/syslog | grep dnsmasq.\*Server & sudo pkill -USR1 dnsmasq