Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I check which DNS server am I using (in Linux)? I am using network manager and a wired connection to my university's LAN. (I am trying to find out why my domain doesn't get resolved)

share|improve this question

4 Answers 4

up vote 22 down vote accepted

You should be able to get some reasonable information in:

$ cat /etc/resolv.conf 
share|improve this answer
10  
However, please be aware that (on modern Linuxen) the contents of /etc/nsswitch.conf dictate what name services are used (DNS, LDAP, etc) and in what order. Say fgrep hosts: /etc/nsswitch.conf. If it only references DNS, /etc/resolv.conf is the right place to look for your nameservers. But chances are you're also using mDNS (aka ZeroConf, aka Avahi, aka Bonjour, etc), etc. In that case, things depend on what you're using. –  Alexios Jan 12 '12 at 13:35

I think you can also query DNS and it will show you what server returned the result. Try this:

dig yourserver.somedomain.xyz

And the response should tell you what server(s) returned the result.

You can also tell dig to query a specific DNS server.

share|improve this answer
    
On Debian this requires the dnsutils package. –  Faheem Mitha Jan 14 '12 at 20:54

Here's how I do it:

nm-tool | grep DNS
share|improve this answer
5  
This one is usefull if you are using VPN and NetworkManager. Your /etc/resolv.conf will point to your machine, with dnsmasq resolving names as configured by NetworkManager. –  Grzegorz Żur May 30 '13 at 11:32

If you are using network manager probably you get all network parameters from your dhcp server at your university.

If you don't want use your shell to check your dns settings (as described by hesse and Alexios), you can see them from the panel "Network information".

You can reach this panel by pressing right mouse button on network manager icon and selecting "Connection Information" from the menu.

share|improve this answer

Your Answer

 
discard

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.