How to foward subdomains?

CyberLeo Kitsana cyberleo at cyberleo.net
Thu Aug 2 06:07:09 UTC 2007


Sdävtaker wrote:
> Hello
> Sorry in advance for my english,it is not my main language.
> I got a tiny network with 2 computers and only 1 external ip.
> I configured my router to foward the dns port to machine1, and
> registered it in nic as ns1.mydomain.com, i had successfully moved my
> registered domains to that dns and could run all my services in that
> machine, ie i can http://www.mydomain.com from outside.
> After that i had setup a second machine in the network and i want to
> make this one a subdomain of the first one ie second.mydomain.com,
> this second machine got no external ip.
> How can i set my first machine to foward all the traffic directed to
> that domain?
> Thanks for any help u can give me.
> Sdav

Just recently, I did something similar with two machines hosting a few
domains and subdomains. I found the easiest thing to do was to set up
squid in 'web accelerator' mode (also known as anti-slashdot mode) on my
FreeBSD router, and direct it to forward requests (based on Host header)
to the appropriate backend webserver. In your case, one server could be
running on an alternate port on the same machine Squid is, or bound to a
private IP alias.

This is a touch annoying, though, as squid must know about /every/
/single/ subdomain that is hosted, lest it complain that it cannot
fulfill the request.

-- 
Fuzzy love,
-CyberLeo
Technical Administrator
CyberLeo.Net Webhosting
http://www.CyberLeo.Net
<CyberLeo at CyberLeo.Net>

Furry Peace! - http://wwww.fur.com/peace/


More information about the freebsd-questions mailing list