Allow short hostnames to identify daemons in collector queries. #3694

In many places, primarily in the command line tools, when given a
hostname for a daemon name, we try to turn it into a fully-qualified
name. The ipv6 code made these conversions fail when using
gethostbyname(). When examining the hostent struct, it started ignoring
the h_name field and only looked at h_aliases. h_name is usually the
value we want.