avoid a getaddrinfo if possible
Merge pull request #6572 from amitmurthy/amitm/6556

avoid a getaddrinfo if possible