Consistent hosts

This patch makes `/etc/hosts` file records consistent between container restarts.
Fixes #8972