There's getaddrinfo() for blocking host resolution, but is there a non blocking method?
getaddrinfo()
I don't think there is such a thing but you can always wrap it in a thread and use a semaphore to signal completion.