DD-WRT url forwarding like port forwarding?

1

0

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.

cripto

Posted 2014-04-28T16:16:31.733

Reputation: 365

Are you talking about internal requests from within your network or external requests to a self-hosted domain? – Raystafarian – 2014-04-28T16:52:43.243

I have added the clarification to my question. Thank you for asking. – cripto – 2014-04-28T18:00:55.763

It sounds like you want to set up virtual hosts. – Rob – 2014-04-28T18:17:05.007

It’s “actual” hosts, not virtual. So maybe a reverse proxy. – Daniel B – 2014-04-28T18:49:34.047

Answers

0

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

Here is an example

magum

Posted 2014-04-28T16:16:31.733

Reputation: 136