allow both ipv4 and ipv6 hostnames by default

Refactored the code to use netaddr rather than re-implementing IP
address validation. This gives us IPv6 support for free.

DocImpact
The hostname_require_ipv4 configuration option is being
removed in favor of hostname_require_valid_ip. The latter is more
inclusive and validates both IPv4 and IPv6 addresses.

Change-Id: I36c76169f2ab3bb7f54f67db522309a49ae61f7a
Closes-Bug: #1343192
Merge "allow both ipv4 and ipv6 hostnames by default"