Dann wäre das nicht GetHostByName, sondern GetHostByAddr:
Delphi-Quellcode:
function IPAddrToName(AIPAddr: string): string;
var SockAddrIn: TSockAddrIn;
HostEnt: PHostEnt;
WSAData: TWSAData;
begin
WSAStartup($101, WSAData);
try
SockAddrIn.sin_addr.s_addr := inet_addr(PChar(AIPAddr));
HostEnt := GetHostByAddr(@SockAddrIn.sin_addr.S_addr, 4, AF_INET);
if Assigned(HostEnt)
then Result := StrPas(Hostent^.h_name)
else Result := '';
finally
WSACleanup;
end;
end;