Posted: Mon Aug 13, 2012 15:22 Post subject: Can't route external domain to internal IP addresses
I'm trying to get xip.io to work correctly with DD-WRT. Xip.io is an external domain that provides wildcard DNS for any internal IP.
For example: If my IP address assigned by DHCP is 192.168.1.149, 192.168.1.149.xip.io should resolve to 192.168.1.149 on my local network.
So far, the only way I've figured out how to do this is through adding DNSMasq options for each internal IP address on the network like this: address=/.192.168.1.149.xip.io/192.168.1.149
Is there any way I could get this to work for all IP addresses on my network so I don't have to specify each one in the DNSMasq options and add static leases?
For security reasons, I don't want to stop-dns-rebind, even though that may solve the problem. I'm using build 14896 v24-sp2 on an Asus RT-N16.
I'm no expert in dns or dynamic dns, but I do not see a way around this other than adding entries to dnsmasq.
The "No DNS Rebind" option, when enabled, blocks DNS replies containing IP's from private ranges.
You could however write script which adds the required entry to DNSmasq for every IP which has been assigned by the dhcp server.
I do not know how to obtain the information needed for this script (e.g. how to get the list of leases), but I am sure it can be done if you want it bad enough. Maybe the scripts in this thread http://www.dd-wrt.com/phpBB2/viewtopic.php?p=684874 can be of use. They update the lease table based on a csv file. Maybe they will reveal how to obtain the leases. After that it's a simple matter of adding them to the dnsmasq config file and restarting dnsmasq.
How ever, if I'm not mistaken, by adding these entries you do not actually use xip.io. Either the dns request will never reach xip.io or the answer will be blocked. In either case the response will be given from the static list of hosts you have added. So you might as well add add 192.168.1.1.somethingelse.tld...
Let’s put it this way. Using DNSMasq as you are, I don’t see the need for xip.io. You’re using your own wildcards locally. Seems to me xip.io is for someone who doesn’t have the luxury of their own DNS server.
I realize that. I don't want to use DNSMasq that way because it defeats the purpose of xip.io. I would like to use xip.io, however, because support for it is built into pow, a rails server that maps multiple hosts to the same IP address.
But if I don't touch anything in a default DD-WRT config, the xip.io domain won't resolve to any internal IP addresses.