Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
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.
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.