Restart networking after modifying the hosts file

Fixes #291