gethostbyname is an old way to resolve domain name, The disadvantage of it is that it does not support IPV6, so there is a gethostbyname2 which replaces gethostbyname, it supports both IPV4 and IPV6 resolving. Textbooks recommend to use getaddrinfo. The reason why it is slow is that getaddrinfo will resolve both IPV6 and IPv4 by default.

Nov 01, 2018 services(5) - Linux manual page SERVICES(5) Linux Programmer's Manual SERVICES(5) NAME top services - Internet network services list DESCRIPTION top services is a plain ASCII file providing a mapping between human- friendly textual names for internet services, and their underlying assigned port numbers and protocol types.. Every networking program should look into this file to get the port number (and protocol) for its se Linux getaddrinfo not working with .local domains - Server

linux - "POSSIBLE BREAK-IN ATTEMPT!" in /var/log/secure

services(5) - Linux manual page SERVICES(5) Linux Programmer's Manual SERVICES(5) NAME top services - Internet network services list DESCRIPTION top services is a plain ASCII file providing a mapping between human- friendly textual names for internet services, and their underlying assigned port numbers and protocol types.. Every networking program should look into this file to get the port number (and protocol) for its se Linux getaddrinfo not working with .local domains - Server

Linux command line utility to resolve host names using

The getaddrinfo function is the ANSI version of a function that provides protocol-independent translation from host name to address. The Unicode version of this function is GetAddrInfoW. Developers are encouraged to use the GetAddrInfoW Unicode function rather than the getaddrinfo ANSI function. The getaddrinfo function returns results for the NS_DNS namespace. How To Patch and Protect Linux Glibc Getaddrinfo Stack-based Buffer Overflow Zero Day Vulnerability. A stack-based critical buffer overflow was found in the way the libresolv library (glibc) performed dual A/AAAA DNS queries. A remote attacker could crash or, potentially, execute code running the library on Linux.