Ubuntu 14.04 | dnsmasq

My goal is to setup a catch-all HTTP server using an Ubuntu 14.04 workstation as DNS resolver. I have installed dnsmasq on my Ubuntu 14.04 OS using apt-get install dnsmasq and I've confirmed it's running using 'service dnsmasq status'.

My goal is to route all traffic on the machine via dnsmasq. In the configuration file for dnsmasq, I have the following:

no-resolv server=

I want a scenario where opening firefox and navigating to *.com/net/org/etc pulls up a locally hosted site on my computer instead of actually having such requests routed through the nameservers configured in resolv.conf and processed by the corresponding DNS server(s).

Been at this one for hours. Any suggestions are welcome.

Update: Thanks for suggesting a possible duplicate, while we're trying to achieve the exact same thing, my issue is that the changes in /etc/dnsmasq.conf are not taking effect.


2 Answers 2


You have set up the local name server, but you haven't made your OS use it.

You need to edit your /etc/network/interfaces under your outgoing network interface, and add:


After that you need to restart your networking so that the new DNS settings take effect.

  • Thanks! Can you update your answer to reflect the steps to accomplish this?
    – Ralph
    Apr 11, 2015 at 9:38
  • This depends on your Linux distribution, there aren't any universal procedures for this. If you tell your distribution, then I can find out the instructions for that. Apr 11, 2015 at 17:12
  • It's the first line in my question.
    – Ralph
    Apr 11, 2015 at 17:46
  • Updated answer. Apr 11, 2015 at 23:08

I've added entries to my dnsmasq config to speed up page loads and cut out ads with additions like this:


These will match any path on TARGET_DOMAIN and respond with as the IP address. Change that to whatever your inside web server's IP address is and you should accomplish your goal here

  • Thanks for your answer. In my case, I used address=/#/dest-IP to route all traffic, # being a wildcard.
    – Ralph
    Apr 12, 2015 at 6:28

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