Refactor dns hosts.