DNS is an internet service that maps domain names, like rosettacode.org, to IP addresses, like 66.220.0.231.

Use DNS to resolve www.kame.net to both IPv4 and IPv6 addresses. Print these addresses.




program DNSQuerying;
 
{$APPTYPE CONSOLE}
 
uses
  IdGlobal, IdStackWindows;
 
const
  DOMAIN_NAME = 'www.kame.net';
var
  lStack: TIdStackWindows;
begin
  lStack := TIdStackWindows.Create;
  try
    Writeln(DOMAIN_NAME);
    Writeln('IPv4: ' + lStack.ResolveHost(DOMAIN_NAME));
    Writeln('IPv6: ' + lStack.ResolveHost(DOMAIN_NAME, Id_IPv6));
  finally
    lStack.Free;
  end;
end.