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.

Ralph
  • 802
  • 11
  • 25

2 Answers2

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

phealy3330
  • 73
  • 1
  • 8
  • Thanks for your answer. In my case, I used `address=/#/dest-IP` to route all traffic, # being a wildcard. – Ralph Apr 12 '15 at 06:28
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.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58