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>