Does Win32 getaddrinfo() use C:\Windows\System32\drivers\etc\hosts?
We want to use C:\Windows\System32\drivers\etc\hosts to specify IPv6-only addresses (which are NOT part of the DNS), and let our Win32 console application use it via getaddrinfo(), but it does not find it.
Why? Is there maybe an API which uses C:\Windows\System32\drivers\etc\hosts AND DNS?
No.
C:\Windows\System32\drivers\etc\hostsis a DNS file, which can be opened directly with Notepad and redirects the IP address.The
getaddrinfofunction provides protocol-independent translation from an ANSI host name to an address.If you want to specify IPv6-only addresses, you can see my answer How to display current IPv6 connections?