1

I have a ddwrt router and I would like the following behavior.

say I own the domain example.com and like wise, I own *.example.com.

Say I have my dns set to forward all requests for example.com or any of its sub domains to 1.2.3.4 (my WAN).

Now, lets say someone on the internet requests foo.example.com. DNS responds with 1.2.3.4 say I want that request to be handled by a server behind my ddwrt with local ip 192.168.1.12. Therefor ddrwt does so.

Someone else at the same time requests bar.example.com. DNS responds with 1.2.3.4. but now I want DDWRT to send the service to 192.168.1.33

Note that both requests are running on the same port and port forwarding is not enough.

I have simulated this behavior with multiple out facing ips via dns response. However, this is a much cheaper setup.

Can this be accomplished via iptables on the ddwrt

I found this, however, this seems to only be for web access. There services I have behind the ddwrt could range from ssh to vpn and more.

EDIT Clarification:

The requests are external. IE: foo.example.com could be requested from anywhere in the world.

4
  • Are you talking about internal requests from within your network or external requests to a self-hosted domain? Commented Apr 28, 2014 at 16:52
  • I have added the clarification to my question. Thank you for asking.
    – cripto
    Commented Apr 28, 2014 at 18:00
  • It sounds like you want to set up virtual hosts.
    – Rob
    Commented Apr 28, 2014 at 18:17
  • It’s “actual” hosts, not virtual. So maybe a reverse proxy.
    – Daniel B
    Commented Apr 28, 2014 at 18:49

1 Answer 1

0

You could match for your domain name in the dns request and forward the packets accordingly.

Here is an example

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .