I'm currently trying to set up an access point on my raspberry pi, but as soon as I install 'dnsmasq', the internet connection is lost ('unknown host' when trying to ping any server).

What causes this and how do I connect it to the internet again?

P.S.: i can access it via ssh, so local network is still working...

edit: so apparently it's just the dns-server, because it works when pinging the numeric ip instead of e.g. google.com; I assume the dnsmasq/nscd service is overwriting the working configuration

  • I believe what dnsmasq does is set your DNS address to, which dnsmasq listens to, and then it forwards the query to the appropriate external server. – saiarcot895 Jul 6 '15 at 15:44

You need to configure dnsmasq. Look in /etc/dnsmasq.conf. I don't know much about your situation, but I'm certain that you'll need to set these options:

listen-address=  # Or whatever the machine's IP address is.

The file /etc/resolv.conf is what every process other than dnsmasq looks into to find what IP address to send a DNS query to. On the machine running dnsmasq, /etc/resolv.conf should have it's own IP address in resolv.conf.

Then, you need to have /etc/dnsmasq.resolv containing the IP address of the next level up's DNS server. That might be your company's DNS server, or your ISP's DNS server, or something like, or whoever you use.

I have a superstition that after changing dnsmasq.conf or dnsmasq-resolv, you have to stop and start the dnsmasq process. I could be wrong.


dnsmasq should read /etc/resolv.conf and use the DNS servers there. In case that doesn't work for some reason, you can manually specify what DNS servers to use. To do that, in /etc/dnsmasq.conf, add server= followed by the IP address of the DNS server. For example, to use and as your DNS servers, use:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.