Rewrite DNS lookup API to remove a memory leak and keep it from coming back.