update the process for generating the /etc/hosts file to make it more robust

Merged Chris Hines requested to merge update_makehosts into master

Merge request reports