Write hosts file to /tmp first , then move it to /etc/hosts