0

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:

interface=eth0
interface=wlan0  
address=/#/192.168.1.1
no-resolv server=192.168.1.1
listen-address=192.168.1.1

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.

0

2 Answers 2

1

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:

dns-nameservers 192.168.1.1;

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

4
  • 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
1

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

address=/TARGET_DOMAIN1/127.0.0.1 
address=/TARGET_DOMAIN2/127.0.0.1 
...

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

1
  • 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.