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.

I have Ubuntu 12.04 installed, and also use unbound and usually use openDNS as my DNS server.

When I run dig google.com say I get SERVER: 127.0.0.1#53(127.0.0.1). What exactly is this thing listening on port #53? is this unbound or is it something to do with dnsmasq (do I even have dnsmasq installed as dnsmasq.conf doesn't seem to be in /etc?)

In resolv.conf there is nameserver 127.0.0.1 but then in network manager I have the DNS servers pointed to the two openDNS addresses. So what is going on here? does the local nameserver point to dnsmasq which then uses the values from network manager? or is it unbound that is in fact listening?

share|improve this question
    
what are you trying to accomplish ? –  Rahul Patil Dec 25 '12 at 20:29
1  
just understanding really –  fpghost Dec 25 '12 at 20:48
    
is this ubuntu server edition or what ? –  Rahul Patil Dec 25 '12 at 20:49
    
no just desktop –  fpghost Dec 25 '12 at 22:23
add comment

2 Answers

up vote 4 down vote accepted

By default, on Ubuntu 12.04, NetworkManager uses Dnsmasq as a DNS resolver. Only the dnsmasq-base package is installed by default, so Dnsmasq runs in a default configuration where it only resolves names based on the upstream servers specified by command line options (plus the contents of /etc/hosts). You have no /etc/dnsmasq.conf because that file is only present in the optional package dnsmasq.

To see whether your system is currently using Dnsmasq or Unbound for DNS queries, run netstat -ulnp | grep :53.

In Ubuntu 12.04, NetworkManager doesn't play well with other DNS resolvers (see bug 959037Thomas Hood's summary pretty much covers it all). To keep running Unbound together with NetworkManager, your best bet is to tell NetworkManager not to run Dnsmasq (you don't need it in addition to Unbound, not unless you're using features of Dnsmasq that NetworkManager doesn't use). To do that:

  1. Edit /etc/NetworkManager/NetworkManager.conf to comment out the line containing dns=dnsmasq (add a # at the beginning of that line).
  2. Restart NetworkManager with service network-manager restart.
share|improve this answer
    
how does Ubuntu currently know to use Unbound?(it does indeed seem to be using it); what I'm getting at is why I don't need something like dns=unbound in /etc/NetworkManager/NetworkManager.conf ? and given that I currently have dns=dnsmasq in that file, why is Ubuntu actually using unbound? –  fpghost Dec 25 '12 at 23:44
    
@fpghost Which one you get depends on which one started first. If you boot with no network, you'll get Unbound because it will start first. If you boot with a network connection, I think it's a toss-up. –  Gilles Dec 26 '12 at 0:00
    
OK, but what I was really wondering is rather than completely comment out the dns=... line to stop dnsmasq being used, what if I replace the line with dns=unbound? Otherwise how does NetworkManager know that unbound will be the local resolver? –  fpghost Dec 26 '12 at 11:03
add comment

In ubuntu 12.04 dnsmasq is now running by default due to being hard coded into network manager. Using dnsmasq as local resolver by default on desktop installations That’s the second big change of this release. On a desktop install, your DNS server is going to be “127.0.0.1? which points to a NetworkManager-managed dnsmasq server.

SERVER: 127.0.0.1#53(127.0.0.1)   

this means you are getting ans of your query from local dns i.e DNSMASQ.

If you don’t want a local resolver you can turn it off DNSMASQ using the following procedure You need to edit /etc/NetworkManager/NetworkManager.conf file

gksudo gedit /etc/NetworkManager/NetworkManager.conf

and comment out the following line from

dns=dnsmasq

to

#dns=dnsmasq

Save and exit the file

Now you need to network-manager using the following command

sudo restart network-manager

Reference link

share|improve this answer
1  
OK, but what if I also have Unbound installed does this take precedence over dnsmasq as the local resolver? are both listening on #53? how do they get on together? –  fpghost Dec 25 '12 at 22:26
    
also why is /etc/dnsmasq.conf absent? –  fpghost Dec 25 '12 at 22:33
add comment

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.