The hosts manpage says a single hostname can have just one entry in /etc/hosts:
For each host a single line should be present with the following information:
But this is inacurate as it can have one IPv4 and one IPv6 entry (line). Programs using getaddrinfo(3) will prefer IPv6 by default (can be changed in /etc/gai.conf), others that directly parse the hosts file (pdns-recursor) will use their own methods.
The 'inet' node should be changed to multi, the host_name.py script modified to support multiple 'inet' lines and a check added that allows only one IPv4 and IPv6 address.