getipnodebyname(3) Library Functions Manual getipnodebyname(3) getipnodebyname, getipnodebyaddr, freehostent - (libc -lc) #include #include #include [[deprecated]] struct hostent *getipnodebyname(const char *name, int af, int flags, int *error_num); [[deprecated]] struct hostent *getipnodebyaddr(size_t size; const void addr[size], size_t size, int af, int *error_num); [[deprecated]] void freehostent(struct hostent *ip); ( glibc). getaddrinfo(3) getnameinfo(3) . getipnodebyname() getipnodebyaddr() . : struct hostent { char *h_name; char **h_aliases; int h_addrtype; int h_length; char **h_addr_list; }; gethostbyname(3) gethostbyaddr(3) IPv4. getipnodebyname() getipnodebyaddr() . gethostby . freehostent() hostent. getipnodebyname() getipnodebyname() name. af : AF_INET name IPv4 IPv4. AF_INET6 name IPv6 IPv6. flags . OR . flags 0 . AI_V4MAPPED AF_INET6 IPv4 IPv6 IPv4 IPv6. AI_ALL AI_V4MAPPED IPv4 IPv6. IPv4 IPv6. AI_ADDRCONFIG AF_INET6 IPv6 IPv6 IPv4 IPv4 . AI_V4MAPPED. AI_DEFAULT (AI_ADDRCONFIG | AI_V4MAPPED). getipnodebyaddr() getipnodebyaddr() addr. af : AF_INET addr struct in_addr size sizeof(struct in_addr). AF_INET6 addr struct in6_addr size sizeof(struct in6_addr). NULL error_num : HOST_NOT_FOUND . NO_ADDRESS . IPv4 IPv6 . NO_RECOVERY . TRY_AGAIN . . hostent : h_name . h_aliases . . h_addrtype af getipnodebyname() getipnodebyaddr(). h_addrtype AF_INET af AF_INET. h_addrtype AF_INET6 af AF_INET6. h_length sizeof(struct in_addr) h_addrtype AF_INET sizeof(struct in6_addr) h_addrtype AF_INET6. h_addr_list . . . RFC 2553. glibc 2.1.91-95 . . getaddrinfo(3) getnameinfo(3) inet_ntop(3) inet_pton(3) 3 . . : . 6.18 21 2025 getipnodebyname(3)