Hi,

I wanted to know if the following was possible on a linux (in particular) box:

Assume I have (at most), all of these entries in /etc/hosts

custom1.company.com nnn.nnn.nnn.nnn
custom2.company.com nnn.nnn.nnn.nnn
default.company.com nnn.nnn.nnn.nnn

where nnn is some specific IPv4 address number

I want to lookup the hosts in say this order:

custom2.company.com
custom1.company.com
default.company.com

Now sometimes, I may only have the default entry, and sometimes I may have
the custom1 and / or custom2 entries also in /etc/hosts. So, any
combination from 0 to all 3 entries is possible at any point in time. This
configuration would not change often, but any combination of entries is
possible.

If the custom2 entry is not found, I want to try custom1, and if not ok,
then I want to try default. Importantly, I do _not_ want _any_ DNS lookup
to be performed for _these_ _specific_ host lookups, because I want an
immediate failure if the entry is not defined in /etc/hosts. Note: I want
an _immediate_ failure initially, _and_ for every lookup thereafter - an
initial DNS lookup that fails after a DNS lookup timeout, and then perhaps
caches that failure result is no good, because every lookup must respond
immediately (and of course /etc/hosts and DNS service entries can change at
any time so even then, cacheing is not useful).

Assume that I am using software that I cannot change, and so workarounds
like actually reading the /etc/hosts file to see which entries exist,
cannot be wired into the software.

I am thinking of something functionally like a like /etc/disable_dns_lookup
that I can also copy all 3 of the above entries to, and linux will _never_
try DNS if the entries appear in /etc/disable_dns_lookup.

Any solutions / ideas ?

Thanks
Andrew


Message sent using MelbPC WebMail Server



_______________________________________________
luv-main mailing list
[email protected]
http://lists.luv.asn.au/listinfo/luv-main

Reply via email to