Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a registered domain name (thisexample.net), which I forward to a dynamic URL at DynDns (bounce.dnsalias.net) as my internet access comes over cable and doesn't provide a static IP address. My router (openwrt) forwards port 80 to an apache server on the LAN.

This works for machines seeking the URL thisexample.net from outside the LAN, and for machines inside the LAN going to the server's LAN address (eg, 192.168.1.xxx). However, LAN machines going to the URL thisexample.net (or www.thisexample.net) bring up the router's admin page, as if they had been addressed 192.168.1.1.

I want to experiment with the subdomains, such as beta.thisexample.net. As I understand it, one way to set them up is to use apache's VirtualHost directive with the address name -- but the LAN boxes won't be able to reach such subdomain pages as addressing the domain doesn't get them to the server in the first place.

Why aren't LAN boxes able to use the URL address?
How can I configure things so they can? Is this a poor approach to experimenting with subdomains in the first place?

share|improve this question
    
In what way are you experimenting with sub-domains? –  Daniel Lucas Jun 22 '09 at 21:42
    
I want to get enough control to create sites like beta.myexample.net, gamma.myexample.net, etc. and have each address serve a different site. –  chernevik Jun 23 '09 at 1:22

2 Answers 2

up vote 1 down vote accepted

Both external clients and your internal boxes are reaching the same, proper IP address that dyndns is giving them. The real problem is that your router is only performing "port forwarding" for 80 on the external-facing interface. Any connections through internal-facing interface just see openwrt's own page on non-forwarded port 80.

This is purely issue of iptables on openwrt (DNAT should be specified twice: with -i ethX and then with -i ethY).

If you want to work around the problem via DNS, use bind's feature called "view". But this is a clumsy solution.

share|improve this answer
    
Thank you. I don't know how to specify DNAT, but I can go to school on iptables, and probably should in any case. –  chernevik Jun 23 '09 at 1:21

Create a manual record on your internally facing DNS server.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.