Make /etc/hosts records consistent

Fixes #8972

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Test for etchosts consistency

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Merge pull request #8983 from LK4D4/consistent_hosts

Consistent hosts