LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-24-2004, 01:56 PM   #1
kevinmarsh
LQ Newbie
 
Registered: Jun 2004
Posts: 3

Rep: Reputation: 0
Question Subdomains, Router, BIND?


I have a LAN setup that consists of two Debian boxes and a D-LINK
router. I have a domain setup as well that redirects
just fine to *one* of my boxes. I'd like to setup subdomains though to
point to each box (i.e., linux1.domain.com --> 192.168.0.10 on my LAN, and
linux2.domain.com --> 192.168.0.20 on my LAN). I only have one IP.

Should I install BIND on a machine? How would I set it up?

Thanks,
Kevin Marsh
 
Old 06-24-2004, 03:09 PM   #2
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
kevinmarsh

Not sure about Debian but in Redhat you can add aliases to /etc/hosts

192.168.0.10 linux1.domain.com
192.168.0.20 linux2.domain.com

I think for 2 machines BIND is a bit overkill

Pete
 
Old 06-24-2004, 03:11 PM   #3
kevinmarsh
LQ Newbie
 
Registered: Jun 2004
Posts: 3

Original Poster
Rep: Reputation: 0
That's fine for inside the LAN, but what about 'the outside world'? /etc/hosts only works on one machine.

Kevin
 
Old 06-24-2004, 03:17 PM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
I assume what you want to do is be able to have the same service (eg: http) running on each box, with different content, and be able to get to each one from outside.

You cannot do this without some modifications because you only have a single IP and you can only forward each port to one IP (eg: port 80/TCP for http).

What you can do is use an http redirect site. You can point your other DNS record at the redirect site. That site runs a CGI wrapper that will accept requests on port 80 and forward them to your IP on a different port (like 81/TCP). Then you can forward that new port on your router to the other machine internally. Note that the only redirection service I've seen was a paid service.
 
Old 06-24-2004, 03:20 PM   #5
kevinmarsh
LQ Newbie
 
Registered: Jun 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Yeah, different services, different boxes. But not necessarily http.

What about subdomains?
 
Old 06-24-2004, 04:11 PM   #6
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
Sub-domains are irrelevent. I assume what you mean is that you want to refer to each internal box with some external DNS record? All you have to do is setup and A record in DNS that points to the IP that is hosting the service. As mentioned, you only have one IP so only have one instance of each service on that IP. You may have any number of DNS names pointing to that IP.

Also as mentioned above, if you want to run two instances of the same service then you have to use off-site port forwarding to convert the well-known port into the temporary port you're using to forward it across your firewall. For instance (similar to the http example above) you could have some other site receive SMTP traffic for you (e-mail) on the normal port 25, then forward it to you on port 2525.

The key is that each Internet service has a well-known port and remote clients & services need to connect to you on that well known port. Since they can't connect to both of your internal hosts through the firewall on the same port, you need to use an alternative port for the second machine. You don't have any way to tell remote clients/servers to use your alternative port, thus the need for off-site forwarding (convert the standard port to your temporary port).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BIND 9 and in-addr.arpa subdomains carsten.engel Linux - Enterprise 6 07-18-2005 03:21 PM
BIND/DNS: Some subdomains resolve, some don't natetheros Linux - Networking 0 04-22-2005 06:36 PM
Subdomains tommytomato Linux - Newbie 5 02-04-2004 09:48 AM
Setting BIND/Sendmail behind a broadband router/firewall ppuddick Linux - Networking 1 03-27-2003 06:20 PM
Bind and subdomains jnsc Linux - Software 2 03-01-2003 08:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration