1

I have dual stack Windows m/c, with IPv4 and IPv6 address. The etc\hosts contains only IPv4 address of that hostname. So whenever I call getaddrinfo() function, it returns IP address from etc\hosts file (i.e IPv4 only not IPv6 address).

ipconfig command shows both IPv4 as well as IPv6 address.

How to configure getaddrinfo() function to always return IPs from DNS rather than etc\hosts file ? Any other way to do this ?

pevik
  • 4,523
  • 3
  • 33
  • 44
Nilesh Shinge
  • 315
  • 1
  • 4
  • 9

1 Answers1

2

Name resolution is entirely independent from address configuration. Unless the name resolver learns of the IPv6 address (by inclusion in the hosts file, or a DNS entry, or mDNS, or...), it cannot return the address.

Simon Richter
  • 28,572
  • 1
  • 42
  • 64