PDB-554 Correct handling of /etc/hosts creation and ensure hostnames are set

Signed-off-by: Ken Barber <ken@bob.sh>