On Sun, 21 Sep 2008 19:19:46 +0200 Momesso Andrea <[EMAIL PROTECTED]> wrote:
> On Sunday 21 September 2008 18:47:24 Robert Bridge wrote: > > On Sun, 21 Sep 2008 15:08:18 +0200 > > > > Momesso Andrea <[EMAIL PROTECTED]> wrote: > > > My home server is 192.168.1.5 in my home wan, the hostname of the > > > machine is "fandango", and the the /etc/hosts in my laptop looks > > > like this: > > > > > > [...] > > > 192.168.1.5 fandango > > > > > > Sometimes I need to connect to the server while I'm far from > > > home, so the server has also a dyndns address, let's say > > > "fandango.dyndns.org". > > > > > > When I connect from outside my wan I use "fandango.dyndns.org", > > > when I'm at home just "fandango". > > > > > > Is there a way to tell my laptop to always use "fandango" and, > > > if "192.168.1.5" is available, to resolve it this way, otherwise > > > to resolve it as "fandango.dyndns.org". > > > > > > This way I will avoid double configurations, double password > > > stored in firefox, ecc... > > > > > > Any ideas? > > > > Well, when I used to switch my laptop between college (college > > didn't use DHCP!) and home networks, I was reduced to a script to > > switch configs for eth0... > > > > It sounds like all you need to do is swap out the hosts file > > depending on which network you are on, this shouldn't be > > difficult... > > Like having a /etc/hosts.home and a /etc/hosts.world and a script > that sysmlinks them to /etc/hosts depending on the fact that i can > ping or not 192.168.1.5? Basically, I would probably look at methods of hooking it onto the IP assigned to the device (ifplugd should be able to do this), but that is the basic idea.
signature.asc
Description: PGP signature

