I have a need to collect DNS aliases (CNAME records) and use them, given a hostname. Sounds simple, no?
It isn't. Our DNS is secure, so I can't simply transfer the zone local and parse it myself; I have to gethostbyname the addresses and then address-by-address perform a gethostbyaddr to obtain all the possible aliases.
There should be something simpler than this - I can't be the first person to need a list of all related aliases to a hostname, can I? - but I can't find anything. Two days of manuals and perusing CPAN aren't getting me anywhere... can someone help?
No freaking way it compiled on the first try...