Move host resolving into hosts module.