Ubuntu – How to find out which DNS server the wlan0 is using Kubuntu 15.04

dnskubuntunetworking

BACKGROUND

I am trying to find out what DNS server is being used when I connect to the internet with my wlan0 device. I am running Kubuntu 15.04.

I have searched around and tried a few solutions, none of which work for me. Here is what I have tried:

1.
Using the nmcli command

nmcli dev list | grep DNS

as per an answer to the similar question asked here.

This was marked as the answer for the OP, but for me I just get the following output:

Error: 'dev' command 'list' is not valid.

2.
Reading resolv.conf:

cat /etc/resolv.conf

This does not give me the DNS information for my connection.

  1. Using nm-tool

nm-tool does not appear to be installed on my system. So that's not the correct answer for me.

  1. Using dnsmasq

There are a few answers which involve the use of dnsmasq. But in all cases I have not understood the answer enough to use it and I don't know what dnsmasq is.

QUESTION

How do I find out what DNS a connection is using, via the command line or GUI, with Kubuntu 15.04?

[EDIT]

It appears that I have had difficulty in articulating this question, because many people have provided answers which – whilst correct – are not quite the answers to the question I had in mind. Here is my attempt at clarification:

The answers provided so far simply give me the address of my router, because my router is responsible for providing the internet connection. But the question I really had in mind was; what internet DNS server is used when I type, for example, "www.google.com" into an internet browser?

I thought this would be relatively easy to find out, mainly because it's easy to dictate which internet DNS server is used myself. I can, for example, bring up my connection settings and tell it to use 8.8.8.8 for DNS, which is Google's public DNS server. My question, then, is; if I don't dictate any specific DNS server, and leave the router to use whatever it is assigned, how do I find out which DNS server(s) it is using?

Best Answer

With nmcli you can check which dns servers dnsmasq is configured with:

nmcli dev show wlan0 | grep -i dns

An example would be:

$ nmcli dev show wlan0 | grep -i dns
IP4.DNS[1]:                             10.11.12.1
IP4.DNS[2]:                             10.11.13.1
Related Question