How to know what DNS am I using in Ubuntu 12.04

We used to get current DNS settings by:

  cat /etc/resolv.conf

But Ubuntu 12.04 has changed to use the resolvconf framework. The above commond will only give me 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.0.1

And that is not the current DNS settings of my machine.

So, is there any kind of file or command I can refer to?


Solution 1:

Let's assume that NetworkManager is managing your network configurations.

Run in terminal

nm-tool | tail -n 8

(Here tail is optional, just for your convenience.) This will tell you your connection information, similar to ipconfig.

Solution 2:

Go to the network connections next to the volume icon in the taskbar and click on Connection Information

Connection Information Screenshot

Solution 3:

In 12.04, NetworkManager is the manager of network connections by default.

This is why you have only the loopback address in resolv.conf.

Instead of looking into this file, check each of your network connections details in the following folder :

ls /etc/NetworkManager/system-connections/

and choose the connection you want to configure. For example I have "Wireless" connection in that folder

sudo vi /etc/NetworkManager/system-connections/Wireless