Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When investigating how the DNS setup of my OS (Ubuntu 12.04) works, I came to some questions I could not really find on the web.

So what I observed was, that Ubuntu uses dnsmasq as a DNS resolver. When loooking into /etc/resolv.conf, is listed as nameserver.

So the question here is, if dnsmasq is just used as a resolver and the resolver normally looks into /etc/resolv.conf to get the IP of the nameserver, how does this make sense?

It would only make sense if dnsmasq was used as a local DNS server, meaning that the actual OS's resolver would send all DNS queries to the local dnsmasq listening on port 53.

share|improve this question
Check out this askubuntu question: askubuntu.com/questions/130452/… – slm Jun 13 '13 at 14:22
up vote 1 down vote accepted

If you read loads of docs dnsmasq makes a lot of sense.

Everything asks the local port 53 for name resolution so it means it's effectively a local dns proxy. Then when you configure your system DNS it finds external query information.

You don't configure dnsmasq in /etc/resolv.conf. There is something like 3 or 5 files to configure to populate resolv.conf dynamically at run-time.

Check the archwiki for details (it's the best resource I've found for dnsmasq configuration), but suffice it to say that dnsmasq is effectively a local dns proxy that allows you to centralize management of other apps.

Say for example you want to statically configure secure dns over SSL with TCP. You don't have to get every app to understand it. You just have to get dnsmasq to understand it. Then all apps magically understand.

I was hesitant to like dnsmasq for a while, but I now understand why it's a great idea.

share|improve this answer
ah I see, that makes sense. So just to make it clear, dnsmasq is NOT the OS's actual dns resolver? – Quick n Dirty Jun 13 '13 at 14:26
It sort of is (as far as apps can tell), but it's not as far as ultimate resolution is concerned. – RobotHumans Jun 13 '13 at 14:29
hm, so if for example the browser has a dns request, the libc resolver statically sends it to, and dnsmasq then sends the query to the actual dns server, right? – Quick n Dirty Jun 13 '13 at 14:54
yes............ – RobotHumans Jun 13 '13 at 15:01

Your Answer


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.