Consistent hosts

This patch makes `/etc/hosts` file records consistent between container restarts.
Fixes #8972 
Yes, you're right. I'll change code in a minute.