Refactoring local dns resolution out into object