etc_hosts: Add IPv4, IPv6, and Hostname validations, and use them