Longshot; Conditional '/etc/hosts' depending on an iface's subnet?

jvetterli-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f at public.gmane.org jvetterli-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f at public.gmane.org
Tue Dec 1 05:55:57 UTC 2009


On Mon, Nov 30, 2009 at 04:16:26PM -0500, Christopher Browne wrote:
> On Mon, Nov 30, 2009 at 3:30 PM, Madison Kelly <linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org> wrote:
> >  I really doubt this is possible, but is there a way to have entries in
> > '/etc/hosts' return an IP depending on what a given interface's subnet is?
> >  The reason I ask is that when I am at work, I want a given name to resolve
> > the internal IP, but when I am out I need it to resolve to it's external IP.
> > I know I could do this with an internal DNS, but I am hoping there might be
> > an easier way to do it. Currently I just use two different names.
> 1.  Two different names works...
> 2.  Creating custom DNS behaviour could presumably work...
> 3.  Is it conceivable that you might be able to use aliasing in
> whatever service you're using?
> ...

How about a script that read, modifies, and rewrites your hosts file?  

JV
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list