if getaddrinfo() is available, use it, even if IPv6 support is disabled
Support for using getaddrinfo()
was originally added to support IPv6,
and only used if IPv6 support was enabled. Two decades later, support
for getaddrinfo()
is ubiquitous and OS'es have marked gethostbyname()
as deprecated, so use the modern interface whenever we can now.