uses WinSock;
function DomainName2IP(Name: string): string;
var
WSAData: TWSAData;
HostEnt: PHostEnt;
begin
Result := '';
WSAStartup(2, WSAData);
HostEnt := gethostbyName(Pchar(Name));
if HostEnt = nil then Exit;
with HostEnt^ do
Result := PChar(Format('%d.%d.%d.%d', [Byte(h_addr^[0]), Byte(h_addr^[1]),Byte(h_addr^[2]), Byte(h_addr^[3])]));
WSACleanup;
end;