Subject: Reverse lookups with multiple PTR-Records

Reverse lookups with multiple PTR-Records

From: Sebastian <c-ares-ml_at_basti79.de>
Date: Tue, 12 Feb 2008 10:49:40 +0100

Hi all...

i found out neither glibc resolver not c-ares is able to return all
PTR-Records when doing a reverse lookup. Its not common practice to have
multiple PTR-Records for a single IP, but its perfectly legal and some
sites have those.

Therefor i manged to patch ares_parse_ptr_record to fill
hostent->h_aliases with all hostnames received from the query. So you
can now access one hostname via .h_name as usual or the complete list
via .h_aliases.

The attached patch seems to well for me, but i had not much time for
excessive testing yet.

Greets
  Sebastian.

Received on 2008-02-12