LAN Web TCP Delphi

uses winsock;
function IPAddrToName(IPAddr : String): String;
var
SockAddrIn: TSockAddrIn;
HostEnt: PHostEnt;
WSAData: TWSAData;
begin
WSAStartup($101, WSAData);
SockAddrIn.sin_addr.s_addr:= inet_addr(PChar(IPAddr));
HostEnt:= gethostbyaddr(@SockAddrIn.sin_addr.S_addr, 4, AF_INET);
if HostEnt<>nil then
begin
result:=StrPas(Hostent^.h_name)
end
else
begin
result:='';
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.Caption:=IPAddrToName(edit1.text);
end;