What I need to know is: if and how it is possible to somehow have a
(local) dns lookup that uses /etc/hosts to properly handle hostnames
that have two IP addresses (ie, multi-homed boxes).
Background:
The simple way to reverse-resolve dns lookups for, eg, a small local
private subnet that doesn't have a DNS server, is to put an entry
for each box on the network into /etc/hosts.
(Note that I am specifically talking about *reverse* lookups here).
Ok, this works very well for single-homed boxes - one IP, one
hostname, one entry.
But NOT for multi-homed boxes (in this case, servers) which have
interfaces into two different subnets (and they are not acting as
routers).
For example, a client box might have this in /etc/hosts:
127.0.0.1 localhost.localdomain localhost
172.16.1.1 gateway.mydom.com gateway
172.16.2.4 www.mydom.com www
172.16.1.4 www.mydom.com www
That is, it lists the two IPs for the web server.
But the problem is that the *first* matching entry is always the one
used. If the order of the entry in /etc/hosts is as above, a
connection made from www to a client will resove "www" to the IP on
the other subnet, not its local one.
If a mount request comes from www's other interface (it
shouldn't, but could), then things like nfs mount requests and ssh
start to fail due to (local) reverse lookup results that are
inconsistent with the IP it finds for that host.
Ok, I could change the order, but the problem then happens the other
way.
Doing this doesn't seem to work:
172.16.2.4 172.16.1.4 www.mydom.com www
Any suggestions? I've never seen any proper docs (eg, in the
howtos) on this sort of /etc/hosts tweaking over the years, but this
is a problem that is starting to hit me in the face too much to
ignore any longer...
Many thanks.
Cheers
Tony
_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list