function iptoname(ip: string): string;
var
WSAData: TWSAData;
p: PHostEnt;
InetAddr: dword;
begin
result := '''';
WSAStartup(2, WSAData);
InetAddr := inet_addr(PChar(IP));
try
p := GetHostByAddr(@InetAddr, Length(IP), PF_Inet);
if p <> nil then result := p^.h_name;
except
result := '''';
end;
end;