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