dnsmasq - resolving all domains to a specific IP address

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
booler
DD-WRT Novice


Joined: 15 Oct 2014
Posts: 1

PostPosted: Wed Oct 15, 2014 10:22    Post subject: dnsmasq - resolving all domains to a specific IP address Reply with quote
Hi,

I have been attempting, on a LinkSys WRT54GL, to get dnsmasq to resolve all domains to 192.168.1.1, then use iptables to proxy those requests to an external web server. I'm not having much luck.

I started by updating the dnsmasq config file so it looks like this:
Code:
interface=br0
resolv-file=/tmp/resolv.dnsmasq
dhcp-leasefile=/tmp/dnsmasq.leases
dhcp-lease-max=50
dhcp-option=lan,3,192.168.1.1
dhcp-authoritative
dhcp-range=lan,192.168.1.100,192.168.1.149,255.255.255.0,1440m
address=/*/192.168.1.1
stop-dns-rebind


The key change being the addition of the address line, mapping all domains to localhost.

I then added this to the iptables:

Code:
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 80 -d 192.168.1.1 -j DNAT --to 192.168.1.144:80
iptables -A FORWARD -p tcp -d 192.168.1.144 --dport 80 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT


To try to route the requests coming in over wireless to the local address 192.168.1.144.

However, when I connect to the router it won't resolve any external domains to an IP.

Any idea where I'm going wrong?

Thanks.
Sponsor
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6870
Location: Romerike, Norway

PostPosted: Wed Oct 15, 2014 12:59    Post subject: Reply with quote
You don't need to resolve all addresses to specific ip.

Here is a tutorial for setting up a transparent proxy.
http://www.dd-wrt.com/wiki/index.php/Squid_Transparent_Proxy
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum