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.
Hi. I have a small network of computers here at home and I'd like to be able to access them by my publicly addressable IP or host name. For instance, I have a Dynamic DNS hostname, let's just say myhouse.dyndns.org . I'd like to be able to use myhouse.dyndns.org as my IMAP server, or http server or whatever, from when I'm at home just like when I'm away from home.
I'm even sure what that's called though which makes it hard to search for a solution! The closest thing I can think of is local loopback but I don't know if that's really what I'm looking for or not. I have a debian linux-based firewall/proxy/DHCP server through which all my traffic goes, so I assume I can set up routing tables or something to take requests for myhouse.dyndns.org or my static IP address and route them back to 127.0.0.1 or something. I just don't know how to do it.
If anyone can point me in the right direction on this, I'd really appreciate it.
Would putting entries in /etc/hosts do the job?
So edit /etc/hosts - you don't say which distro you're using, I would do:
sudo nano /etc/hosts
Then on the line that looks like this:
127.0.0.1 localhost
change it to this
127.0.0.1 localhost myhouse.dyndns.org
and if you have any other computers defined, like
192.168.0.2 laptop
change them to
192.168.0.2 laptop laptop.myhouse.dyndns.org
You don't need to restart anything for this work, it seems the file is often looked at.
You would need to do this for any machine that you want to be able to reference like this.
And you can do this on windows machines too. The file has the same syntax, just search for hosts, it's somewhere in the Windows System files. It might also be called lmhosts. There is built in help in windows about using this file.
Hi. Thanks for your responses. /etc/hosts won't work for me for a couple reasons.
First of all, I have a number of machines that do different things. For instance, http://myhouse.dyndns.org may be on one computer here, whereas my IMAP server may be on another computer. So I can't just forward myhouse.dyndns.org to 192.168.1.12 or something, as depending on the port, it could be going to any one of a number of computers.
Secondly, workstation in question is a portable (powerbook). Therefore if I change /etc/hosts I have to change it whenever I leave the house, and then whenever I come back home.
I know the hardware provided by my ISP doesn't support local loopback or else (I think) this would Just Work. Therefore, I need to fake it somehow with custom routing, but I don't know how to do that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.