Can't route external domain to internal IP addresses

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


Joined: 07 Sep 2006
Posts: 8

PostPosted: Mon Aug 13, 2012 15:22    Post subject: Can't route external domain to internal IP addresses Reply with quote
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

See screenshot - http://screencast.com/t/eEtv1mahTlF

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.
Sponsor
wuhtzu
DD-WRT User


Joined: 05 Sep 2011
Posts: 50

PostPosted: Mon Aug 13, 2012 17:52    Post subject: Reply with quote
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...
joshkraemer
DD-WRT Novice


Joined: 07 Sep 2006
Posts: 8

PostPosted: Mon Aug 13, 2012 22:04    Post subject: Reply with quote
eibgrad wrote:
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.

What other options can I use to make this work?
wuhtzu
DD-WRT User


Joined: 05 Sep 2011
Posts: 50

PostPosted: Tue Aug 14, 2012 6:18    Post subject: Reply with quote
joshkraemer wrote:

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.

What other options can I use to make this work?


As I said in my post I do not see any options beside what you are already doing as long as you have "No DNS Rebind" enabled.

It blocks dns replies which contains IP's in the private range and that is exactly what you want.
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