> 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).

dns does not use /etc/hosts.

> 
> 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.

I have bind on every box;-)

I've noticed the master dies (or used to die) sometimes; adding more reduces 
the confusion when the master vanishes.

 
> (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...

Looks to me you have a setup like mine; small LAN segregated by speed; a box 
in the middle to connect the segments.

I do not think you can do it using hosts. However, I've never noticed any 
problem mounting files (when the server starts!! I just had a forced reboot; 
it didn't start nfs but the init/nfs said it was running(.

Exports lines like this might help:

/usr/local 192.168.0.0/255.255.0.0(ro,no_root_squash) 
I've told NFS I have one class B network.





_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

Reply via email to