Probier es mal über die WinSock-Schnittstelle:
Delphi-Quellcode:
function HostToIP(host: String): String;
var
HostEnt: PHostEnt;
addr: PChar;
begin
Result := '';
if inet_addr(PChar(host)) = -1 then
begin
HostEnt := gethostbyname(PChar(host));
if Assigned(HostEnt) then
begin
addr := HostEnt^.h_addr_list^;
if Assigned(addr) then Result := Format('%d.%d.%d.%d',[byte(addr[0]),byte(addr[1]),byte(addr[2]),byte(addr[3])]);
end;
end;
end;
uses WinSock nicht vergessen!