Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Yesterday I upgraded to Precise and dnsmasq stopped working. That is, DNS queries to localhost where dnsmasq is listening (127.0.0.1) were refused.

Removing resolvconf (apt-get remove resolvconf) and rebooting solved the issue (found that suggestion somewhere on Google). /etc/resolv.conf looked fine with and without resolvconf in place. No difference at all.

  1. Why would I use resolvconf? Are there any benefits? The Wikipedia article covering resolvconf sucks.
  2. Why did resolvconf interfere with dnsmasq? Is this a known issue?
share|improve this question
    
bla@blubb:~$ [ -f /usr/share/doc/resolvconf/README.gz ] && echo "Found" || echo "Not found" Not Found um. smartass. –  lightxx Nov 15 '12 at 13:52
add comment

3 Answers

The simple answer to (1) is: resolvconf sets itself up as the intermediary between programs that supply this information (such as ifup and ifdown, DHCP clients, the PPP daemon and local name servers) and programs that use this information (such as DNS caches and resolver libraries). As of Ubuntu 12.04 resolvconf is part of the default installation in both the server and desktop variants. It is never necessary to remove resolvconf and people who do remove it usually don't understand it, generally because they haven't read resolvconf(8) and /usr/share/doc/resolvconf/README.gz.

The answer to the second question is that resolvconf most probably did not interfere with dnsmasq. My guess is that you were running into bug #959037.

Explanation: In Ubuntu 12.04 there are two ways in which dnsmasq gets run. There is the traditional standalone version of dnsmasq which listens on all addresses. And there is the new NetworkManager-controlled dnsmasq process which listens only on 127.0.0.1. The latter conflicts with the former unless the former is reconfigured. This problem was solved in Ubuntu 12.10 by having the NM-controlled dnsmasq process listen on 127.0.1.1 instead of 127.0.0.1 and by forcing the standalone dnsmasq process to listen only on addresses assigned to interfaces.

share|improve this answer
    
I've read the manapage and still can't find a reliable way to prepend my own nameservers to resolv.conf. –  Michael Mior Jun 21 '13 at 1:19
    
With resolvconf installed you can prepend a nameserver address by putting nameserver x.x.x.x in /etc/resolvconf/resolv.conf.d/head. Be advised, however, that this is generally not necessary or recommended. Generally there is a more correct way to add "nameserver" lines to resolv.conf. Generally the utility that configures a network interface adds or removes the nameserver addresses available via that interface by running resolvconf -a or resolvconf -d, respectively. Prioritization of nameserver addresses added in this way is governed by /etc/resolvconf/interface-order. –  jdthood Jun 21 '13 at 8:42
    
Actually, putting a nameserver line in head added it AFTER the default nameserver. –  Michael Mior Jun 21 '13 at 15:27
    
I haven't tested it, but it seems like echo x.x.x.x | resolvconf -a lo would do the trick for adding a nameserver which I'd like to be first for all interfaces. –  Michael Mior Jun 21 '13 at 15:42
    
Resolvconf always puts the contents of head at the head (top, beginning) of resolv.conf. –  jdthood Jun 22 '13 at 15:51
show 2 more comments

I've just removed it on my install. I was using pppd manually to dial my 3G modem connection and resolvconf interfered with my dns settings by automatically adding my provider DNS when I wanted to use custom DNS. pppd has options to control this but resolvconf clobbered them with its own settings. I would also like to know answer to this question? It seems like this is some make-it-easier-but-instead-complicate-things kind of package?

p.s. I've found this bug report: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/922578

share|improve this answer
    
thanks for your input. i'd have upvoted it but i'm lacking the rep. –  lightxx May 8 '12 at 5:16
    
@lightxx: Upvoted for you ;) –  Tomasz Zieliński Jul 22 '12 at 1:41
    
Instead of removing resolvconf you could have configured resolvconf to ignore nameserver information coming from pppd. –  jdthood Oct 28 '12 at 19:36
add comment

The simple answer to (1) is: resolvconf sets itself up as the intermediary between programs that supply this information (such as ifup and ifdown, DHCP clients, the PPP daemon and local name servers) and programs that use this information (such as DNS caches and resolver libraries).

That's from the package description. On desktops, it works in conjunction with NetworkManager to handle making and dropping connections smoothly.

So resolvconf, along with dnsmasq, are used in 12.04 to make the DNS info handling more reliable on the desktop version. So in some situations, it does make things better, but the whole situation lacks the documentation in the right place, esp. in the server world.

Despite loads of Googling, I haven't been able to ascertain what is recommended on a server installation.

As far as (2) goes, you're having the opposite problem from me. Dnsmasq works well with resolvconf on my machine and updates the /etc/resolv.conf file to contain 127.0.0.1 but has other problems because dnsmasq doesn't get the ISP name servers from dhclient on eth0 (this is a gateway) nor does it get the name servers I manually entered in the eth0 stanza in /etc/network/interfaces.

Why do you use dnsmasq? Are you also running a gateway with 2 nics? Or is it just a plain desktop? If so, resolvconf co-ordinates with network-manager

share|improve this answer
    
thanks for your answer. i would have upvoted it, unfortunately you need 15 reputation to upvote. lol –  lightxx Aug 25 '12 at 7:22
1  
man pages are great when you know what you need to know. If you don't, they can be puzzling to say the least. Howto's, examples and faqs are what you need when you don't have experience in an area. –  Adam Jun 29 '13 at 14:47
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.