This would replace `/etc/hosts` with `127.0.0.1 <hostname>` (tee overwrites by default). It would also print the line to stdout causing it to end up in the build log.

Maybe this would be better?

    sudo sh -c 'echo "127.0.0.1 "`hostname` >> /etc/hosts'