getaddrinfo()directly (which are wrapped by Indy's
TIdStack.HostByName()method), which uses the OS's own DNS resolver; and then 2) resolve the HostName using
getnameinfo()(which are wrapped by Indy's
TIdStack.HostByAddress()method), which also use the OS's own DNS resolver. Yes,
Host, because it implements DNS manually from scratch, and doesn't use the OS resolver at all. You can query your OS's DNS server(s), or let the user specify them.
TIdSyncstill works, but is deprecated because
TThread::Synchronize()with an anonymous procedure accomplishes the same thing that
TIdSyncwas originally intended for. Read Embarcadero's documentation for How to Handle Delphi Anonymous Methods in C++.