* John Levine: > It appears that angel <[email protected]> said: >>Note that gethostbyname(3), returns the list of alias, so it needs to >>process the CNAMEs. >>High-level programs generally don't need them, though, ... > > I wrote a little test program that prints out the answers from > gethostbyname() and found it provides a list of CNAMEs, but not the > final name with the A record, which makes me wunder who uses that > list and what for: > > dig info.whois.services.net a +noall +answer > info.whois.services.net. 297 IN CNAME whois.nic.info. > whois.nic.info. 297 IN CNAME > whois.identitydigital.services. > whois.identitydigital.services. 177 IN CNAME > whois.identitydigital.gtm.iddg.io. > whois.identitydigital.gtm.iddg.io. 57 IN A 52.37.99.5 > > $ ./gethn info.whois.services.net > names > info.whois.services.net > whois.nic.info > whois.identitydigital.services > numbers > 52.37.99.5 > > Got the sme result on MacOS and FreeBSD and linux.)
Do you print h_name or just the names in h_aliases? I think there once was a time where the canonical name conveyed additional information then the starting name. These days, the canonical name often is just a generic CDN host name. Maybe it makes sense to define the canonical name as whatever comes out of search list processing. It avoids most CNAME processing misuses, where DNS data is accidentally trusted in ways that break security protocols. _______________________________________________ DNSOP mailing list -- [email protected] To unsubscribe send an email to [email protected]
