uses WinSock;
function getIP(sWebAddr: PChar): string;
var
wsa: TWSAData;
begin
Result := '';
if not (WSAStartup($0202, wsa)=0) then
Exit;
try
Result := inet_ntoa(in_addr(PInteger(gethostbyname(sWebAddr).h_addr_list^)^));
finally
WSACleanup();
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(getIP(PChar(Edit1.Text)));
end;