fix parsing of hostnames when we actually want IP addresses.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
First stab at nat tests.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Merge pull request #7475 from erikh/fix_hostname_parsing

fix parsing of hostnames when we actually want IP addresses.