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.

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.con, 127.0.1.1 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
add comment

1 Answer

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. –  hbdgaf Jun 13 '13 at 14:29
    
hm, so if for example the browser has a dns request, the libc resolver statically sends it to 127.0.1.1(dnsmasq), and dnsmasq then sends the query to the actual dns server, right? –  Quick n Dirty Jun 13 '13 at 14:54
    
yes............ –  hbdgaf Jun 13 '13 at 15:01
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.