Getaddrinfo always returns 11001 (host not found)

Although the desired FQDN appears in the etc \ hosts file.

Any idea? Many thanks!

+2
source share
2 answers

Since I have no code, suppose:

getaddrinfo("http://www.example.com");

Does not work; getaddrinfo accepts a hostname not a URL.

+1
source

Take a look at this hostname not translated to an IP address using Winsock

getaddrinfo may indicate an IPv6 address, or there may be more than one IP address on the computer and you are trying to connect to the wrong one.

0
source

Source: https://habr.com/ru/post/1787372/


All Articles