Fix /etc/hosts contents for FQDN hostnames.

The 0.6.5 release of Docker changes the config.Hostname to use a FQDN
instead of a the base hostname. This change updates the /etc/hosts
algorithm to generate valid hosts (and aliases) if the hostname is a
FQDN. Fixes #2520.