On Tue, Jan 10, 2012 at 9:35 AM, Dominic Binks <dbi...@codeaurora.org> wrote:
> The address database can have multiple names for the same IP address so
> gethostbyaddr returns a list - [0] being the first item in the list (and
> usually considered the canonical name)

Point to note: The inverse operation, getting IP addresses from names,
quite frequently returns multiple results - and in that case, there's
no "canonical name". You'll still usually want to take the zeroth
(first) item in the list, but often the list will change in order.
Try, for instance:

$ dig +short www.google.com

which uses DNS rotation as a form of load-balancing.

In any case, you normally just take the first entry.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to