update network details before writing /etc/hosts