Hello all,
I have two computers: a Mac OS X laptop and a Linux desktop PC. When I
am at home, the two computers are behind a router, with IP addresses
192.168.0.3 and 192.168.0 2 respectively. So to log into the Linux
machine from the Mac, I would do "ssh -p <port> <user>@192.168.0.2".
However, to make the same connection from my laptop when I'm elsewhere,
I would need to do "ssh -p <port> <user>@mynode.mydomain.com", where
the name resolution is done by a dynamic DNS service, and the
connection is forwarded by my router.
What I would like to do is to have a hostname which ALWAYS points to my
Linux PC when my Mac tries to resolve it. I use my Linux PC as a mail
server, so it's rather inconvenient having to reconfigure the mail
client on the Mac every time I bring it home. Of course I CAN use the
external hostname to make an internal connection from behind the
router... but for some reason this gives me an extremely slow
connection (many times slower than connecting from outside). Is there
an easy way to do this? The only way I can think of is to write a cron
script which runs ifconfig, and adds an entry into my /etc/hosts file
when my own ip address appears to be 192.168.0.3.
Perhaps this question really belongs in a Mac OS X forum rather than a
Linux one... but I suspect the solution will be the same on any
Unix-based system.
Matthew.
|