Prueba esto a ver que tal:
Código Delphi
[-]
function GetIP : String;
var p : PHostEnt;
s : array[0..128] of char;
wVersionRequested : WORD;
wsaData : TWSAData;
begin
wVersionRequested := MAKEWORD(1, 1);
WSAStartup(wVersionRequested, wsaData);
GetHostName(@s, 128);
p := GetHostByName(@s);
Result := iNet_ntoa(PInAddr(p^.h_addr_list^)^);
WSACleanup;
end;
Saludos