Alexander
Alexander

Reputation: 275

How to get host name from ip address or sockaddr_in structure (C++/WinAPI)?

How to get host name (like "www.google.com") from ip address or sockaddr_in/sockaddr_in6/sockaddr structure (or another) in C++ (WinAPI)?

Upvotes: 0

Views: 6899

Answers (1)

huysentruitw
huysentruitw

Reputation: 28151

You're looking for the getnameinfo function. Example included on the MSDN page.

Upvotes: 2

Related Questions