View previous topic :: View next topic |
Author |
Message |
z-lite Tux's lil' helper
Joined: 04 Aug 2003 Posts: 76
|
Posted: Tue Nov 04, 2003 4:28 pm Post subject: Setting up hostname routing |
|
|
The subject pretty much sums it up. I want to set up hostname-based routing/forwarding on my home network. I have 2 windows (XP and 2003) PCs and a gentoo system. I want to have my gentoo system be the gateway between my ISP and my home network. When someone types in http://linux.z-lite.net, I want my gentoo system to check the DNS record for it and then forward that HTTP request to itself. Or if someone types http://win2k3.z-lite.net, the HTTP request will be forwarded to the Windows 2003 computer.
How would I go about doing this (setting up DNS and the hostname routing in gentoo)? Thanks in advance |
|
Back to top |
|
|
MrPyro Tux's lil' helper
Joined: 14 Aug 2003 Posts: 121 Location: Sheffield, England
|
Posted: Tue Nov 04, 2003 5:48 pm Post subject: |
|
|
This isn't a hostname/DNS thing: you want to handle this is Apache. Look up reverse proxying in Apache (I happen to have been looking at it earlier today for my own purposes). It looks pretty simple to set up and seems to do exactly what you want here (probably with a bit of simple virtual hosting thrown in)
Something like
Code: |
NameVirtualHost IPADDRESS:80
<VirtualHost IPADDRESS:80>
ServerName linux.z-lite.net
ServerAlias linux
DocumentRoot /my/html/is/here
</VirtualHost>
<VirtualHost IPADDRESS:80>
ServerName win2k3.z-lite.net
ServerAlias win2k3
ProxyPass / http://win2k3.internal.ip.address/
ProxyPassReverse / http://win2k3.internal.ip.address/
</VirtualHost>
|
Oh, and you'll need to make sure mod_proxy is loaded, although from a quick scan of my config files it's on by default. _________________ Back off man, I'm a computer scientist |
|
Back to top |
|
|
z-lite Tux's lil' helper
Joined: 04 Aug 2003 Posts: 76
|
Posted: Tue Nov 04, 2003 7:00 pm Post subject: |
|
|
I was using HTTP as an example. If I have a service/game (FTP, Q3) hosted on win2k3 and another game hosted on gentoo, I want the gateway to forward that request based on the hostname. I don't want port-forwarding, just hostname-based routing/forwarding. |
|
Back to top |
|
|
z-lite Tux's lil' helper
Joined: 04 Aug 2003 Posts: 76
|
Posted: Wed Nov 05, 2003 12:16 am Post subject: |
|
|
Bump. Please can anyone suggest something that can help me? |
|
Back to top |
|
|
DingoStick n00b
Joined: 05 Mar 2003 Posts: 63 Location: The Keweenaw
|
Posted: Wed Nov 05, 2003 12:31 am Post subject: |
|
|
The only thing I can think of (which is less a solution and more of a hack) is using Windows' hosts files. They're just like /etc/hosts in Linux. You'll find your hosts file at:
c:\windows\system32\drivers\etc\hosts
(Assuming Windows is installed to c:\windows\). If you're not familiar with hosts files, the system uses it to override hostname lookups. You can put in an IP address, followed by some whitespace, and host names you want associated with that IP. So for you, on your machines, you might want something like:
192.168.1.10 win2k3.z-lite.net win2k3
192.168.1.15 linux.z-lite.net linux
Put that in your systems' hosts files (aforementioned location for Windows; /etc/hosts for Linux) and that should do it for you. _________________
Linux programs, themes, howtos, etc.
|
|
Back to top |
|
|
z-lite Tux's lil' helper
Joined: 04 Aug 2003 Posts: 76
|
Posted: Wed Nov 05, 2003 12:48 am Post subject: |
|
|
I don't know if I'm asking the right question. I want to set up hostname-based routing/forwarding on my linux computer so that if I was at school and wanted to access my linux computer, I would type http://linux.z-lite.net or ftp://linux.z-lite.net (the protocol is irrelevant) and I would be able to access the linux computer. Same concept for my win2k3 box. I know a host file won't do the job since it's on the other side of the network. |
|
Back to top |
|
|
tam1138 Tux's lil' helper
Joined: 28 Oct 2003 Posts: 103
|
Posted: Wed Nov 05, 2003 1:19 am Post subject: |
|
|
The solution is to have multiple external IP addresses on the router so that you can assign a hostname to each. IP forwarding is way below the level of name resolution.
The short answer is no, hostname-based routing and forwarding is not possible. |
|
Back to top |
|
|
|