5

I have a Xubuntu Server 14.04 x64.

How do I list all DNS servers that are in use without NetworkManager which is not even installed?

3 Answers 3

5

They are defined in /etc/resolv.conf.

1
  • Yes, I think you are right now ) Jul 4, 2014 at 12:52
5

The DNS setting can be specified in /etc/network/interfaces and resolve.conf could be blank. Because the DNS entry can be in multiple locations, I think it is best to do an actual DNS query with the verbose mode switch. The output lines that start with the word "Received" will show the DNS server used by your host. In this example, I use www.news.com

host -v www.news.com | grep Received

1
  • This looked promising, but ubuntu@ip-10-0-100-203:~$ host -v www.news.com | grep Received Received 89 bytes from 127.0.0.1#53 in 243 ms Received 100 bytes from 127.0.0.1#53 in 57 ms Received 100 bytes from 127.0.0.1#53 in 57 ms
    – darKoram
    Dec 2, 2015 at 1:10
0

To extend answer from @fkraiem:

You can list DNS servers currently in use by executing the following command from the terminal:

more /etc/resolv.conf

DNS servers are configured during DHCP negotiation or specified statically in /etc/network/interfaces. After that they are added dynamically to /etc/resolv.conf. Do not edit this file though as it will be overwritten with each network switch or system reboot.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .