refactored dns lookups