Change name resolution from gethostbyname() to getaddrinfo(), which implicitly enables IPv6 connections for this option. For better readability of literal IPv6 addresses, allow the host to be placed in square brackets.