Fixed /etc/hosts patch with better logic to identify network settings