I'm writing a simple program to convert an IP address to a hostname, but I'm having trouble with the function GetHostByAddr (found in winsock.h (windows) or netdb.h (linux/unix)). The function takes three arguments (const char FAR * addr,int len, int type) len=4 and type=AF_INET. I've tried simply passing a string (ie: "127.0.0.1") as the addr argument, but it doesn't work. I think it wants the address in network byte order but I can't figure it out. If you have an idea what the problem is (or source code, or a suggestion) please tell me. I will post my source in my next message.