booler DD-WRT Novice
Joined: 15 Oct 2014 Posts: 1
|
Posted: Wed Oct 15, 2014 10:22 Post subject: dnsmasq - resolving all domains to a specific IP address |
|
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. |
|