Choosing Between GetAddrinfoEx and DNSQueryEx for Efficiently Resolving Multiple IP Addresses from Hostnames
Harshal Goyal
20
Reputation points
Hi everyone,
I’m working on a project where I need to resolve hostnames or Fully Qualified Domain Names (FQDNs) to a list of IP addresses. The use case involves resolving a hostname to about a dozen or two IP addresses, and I’m evaluating which function would be most suitable for this purpose between GetAddrinfoEx
and DNSQueryEx
.
Here are my questions:
- What are the key differences between
GetAddrinfoEx
andDNSQueryEx
in terms of performance, flexibility, intended use cases and ease of use for resolving multiple IPs from hostnames/FQDNs? - Is there a specific situation where one function would be preferred over the other for resolving a hostname or FQDN to multiple IP addresses (i.e., in cases with high availability or multiple DNS records)?
- Which one would you recommend for resolving a hostname to multiple IP addresses efficiently in a scenario with as low as 1 -2 to dozen or more addresses?
Any insights into the advantages or best practices for using either of these functions in this context would be greatly appreciated!
Thanks in advance!
Sign in to answer