DNS lookup with multiple IPs

Kevin Darcy kcd at daimlerchrysler.com
Wed Jul 12 19:18:37 UTC 2000


Pat Verner wrote:

> I have a (mail) server which is configured with 6 IP addresses, 5 of
> which are on Local private network addresses, ie 192.168.[01235].18, and
> the last is the public internet address.
>
> This allows for a number of projects, each of which uses a different
> Class-C address in these ranges to see the mail server as local to their
> particular subnet.
>
> Each of the machines on the project subnet is supposed to be configured
> in such a way that their mail host is always 192.168.x.18 (where x is
> determined by the particular project), and similarly their default
> gateway and nameserver should always be configured as 192.168.x.1
> This gateway does an IP-Masquerade to the Internet, and will masquerade
> between the project networks, although this latter should only be the
> case if machines are incorrectly configured.
>
> So far, so good.
> The internal DNS is configured to return all of the addresses for the
> host. I have always been under the impression that if a client goes a
> "gethostbname" and gets multiple responses, it checks first to see if
> one of the responses is on the local subnet, and if so will use that
> address in preference to any other.
>
> I find however, that hosts seem to choose any of these addresses, and
> then try to use that address.  Because of the masquerading host, any of
> the addresses will reach the host succesfully, but obviously at the cost
> of going through the masquerade gateway, (which is running out of
> sockets!)
>
> Is there any rule which should be followed in selecting a particular IP
> address from a list?  And are such rules implicit in the resolver, or
> must they be implemented in the client?

Most client applications just go through the address list in order. You can
configure a "sortlist" option on your servers which will conveniently
arrange the list so that a given client will always see the "near" address
first in the list. But you'd need to configure the same sortlists on
*all* of the servers answering the query. This can be a problem in large,
diverse organizations where different groups maintain different nameservers
(yes, I speak from experience here!)


- Kevin




More information about the bind-users mailing list