The answer is if you've got multiple hosts and nets you should be using
DNS. It isn't *that* complicated to set up (especially if you buy the
O'Reilly DNS book) and you won't regret the extra effort afterwords. In
the amount of time it took to write the message you could have set your
DNS up and certainly you could have after all the time you've probably
spent pulling your hair out trying to make the hosts thing work.

Yep, I have a lot of experience in this, but for the list you gave it
shouldn't take 15 minutes to set up and if the list is longer then it
shows you *really* should set it up.

                        - Matt

Tony Nugent wrote:
> 
> 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

-- 
---------------------------------------------------------------------
Matt Fahrner                                    2 South Park St.
Manager of Networking                           Willis House
Burlington Coat Factory Warehouse               Lebanon, N.H.  03766
TEL: (603) 448-4100 xt 5150                     USA
FAX: (603) 443-6190                             [EMAIL PROTECTED]
---------------------------------------------------------------------



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

Reply via email to