On Sunday 21 September 2008 19:17:29 Momesso Andrea wrote:
> On Sunday 21 September 2008 18:28:48 Alan McKinnon wrote:
> > On Sunday 21 September 2008 15:08:18 Momesso Andrea 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...
> >
> > I'm sure you can get very complex solutions to this, but have you tried
> > something as simple as "search dyndns.org" in resolv.conf?
>
> Sorry but I can't understand what you mean...

Add that line to /etc/resolv.conf. If the resolver can't resolve 
hostname "fandango" it will then also try "fandango.dyndns.org"

You would have to remove "fandango" from /etc/hosts (otherwise it will always 
resolve).

This is of course extremely simplistic, and chances are you need something a 
little more involved. But it's always worthwhile investigating extremely 
simplistic solutions. 

Also, keep in mind that if you use a DHCP server that you control, there are 
all manner of files and configs you can push down to the workstation. 
Capabilities do vary between servers so be sure to check them all out.

-- 
alan dot mckinnon at gmail dot com

Reply via email to