- Getaddrinfo
The
getaddrinfo()
function is part of thePOSIX standardAPI in support for using it as a function to resolve a DNShostname and IP addresses from their human-readable text form into a format for theoperating system 's networking API.The reverse function is
getnameinfo ().Example
The following example uses getaddrinfo() to get a result, then calls
getnameinfo () to get the canonical name for the address. Normally, this will give back the originalhostname , unless the particular address has multiple names, in which case the "canonical" name is returned.ee also
*
Hostname
*Network address
*Domain name system
Wikimedia Foundation. 2010.