# Bind9 - routing domain name to private network?



## zing (Aug 24, 2009)

Hi,

I have a set-up where my bind dns server resides within a host with few jails with private ip's. Bind is not in the jails but few apache servers are. 

My question is:

Is it possible to somehow set up my dns server so that when someone types for example mydomain.com he will be directed to a certain jail with a private ip and apache running on port 80 and when typed  mydomain2.com he will be directed to another jail with different private ip? 

So I would like to somehow direct users based on the typed domain name to my different jails running apache and stuff.
This would not be a problem If I were running apache outside the jails 'cause I could just use the virtual host directive. But I want to separate also other services and need the jails.

So how should I do this, maybe with the aid of ipfw or other firewall?


----------



## Voltar (Aug 25, 2009)

I think what you're looking for is to run a reverse proxy like Varnish (www/varnish) or Pound (www/pound) on the host to direct HTTP requests to the correct webserver.


----------



## zing (Aug 25, 2009)

Voltar said:
			
		

> I think what you're looking for is to run a reverse proxy like Varnish (www/varnish) or Pound (www/pound) on the host to direct HTTP requests to the correct webserver.



Thank you, I think thats exactly the thing I'm looking for. The DNS solution would have seemed a bit ugly if there even were any.


----------



## DutchDaemon (Aug 25, 2009)

See also http://forums.freebsd.org/showthread.php?t=5694


----------

