refine dns_resolve