Consistent hosts

This patch makes `/etc/hosts` file records consistent between container restarts.
Fixes #8972 
I think this should be named `WriteTo` to be consistent with other interfaces and methods within the go stdlib.

http://golang.org/pkg/bufio/#Reader.WriteTo