Hi sankris,

try "getaddrinfo" ( WinSock 2 ).
For details see the MSDN or ask again.

Hope this helps,
Matze