Support hosts update in Docker

Docker bind mounts /etc/hosts, so it is not possible to use install
command (as it tries to unlink the existing file). This commit simply
uses redirection to overwrite the file which is Docker safe. No need to
set permissions as permissions are kept with redirection.