I am experimenting with getaddrinfo and getnameinfo and have gotten a little confused as to the best way to extract the IP address recovered after the function runs. The element in the structure res->ai_addr is a socket address which, if I am reading the documentation correctly, will give me the binary form of the internet address of the host I just looked up.
Is that correct? Also, what is the easiest way to extract that value in to an unsigned long? Wikipedia has an excellent sample program that uses getaddrinfo to resolve a name to an IP address and then getnameinfo to reverse the lookup back to a name, but getnameinfo just takes res->ai_addr as an argument and works great, but one doesn't see how it extracted the IP address. Thanks for all good suggestions. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group _______________________________________________ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users