A reverse lookup has different semantics depending on context. This
can cause unexpected behavior. 1) The object returned from gethostbyaddr() contains a list of host aliases and a list of addresses. In other words, it's perfectly reasonable for there to be multiple hostnames associated with a single address. Ordering is not guaranteed in either list. However the object also has an attribute for the official hostname. Whether that is the long or the short name depends on how the underlying database is configured. For that, see the man page for nsswitch.conf. Conventions vary from one site to another. 2) If your nsswitch.conf causes the reverse lookup to be passed to DNS, the behavior when there are multiple PTR records for a given address is undefined. You might get a list. You might get a singleton that is round-robined. You might consistently get the same singleton from one DNS server and a different singleton from another. You might get nothing. On 13-01-24 10:47 AM, Lamont Granquist wrote: " type="cite"> |
Archive powered by MHonArc 2.6.16.