added failure handling to set default configuration in /etc/hosts file