This PR fixes the needs behind the issue #4514 by enabling fallback to hostname resolution if interface resolution fails.
When resolving addresses, there is already a fallback to getaddrinfo when interface resolution fails.
When allow_dns is set to false, the AI_NUMERICHOST flag is added to getaddrinfo to disable hostname resolution.
The fact we are binding is currently used to disable hostname resolution in TCP and UDP. To enable the fallback to hostname resolution, the allow_dns option should be set to true in all cases.
This PR fixes the needs behind the issue #4514 by enabling fallback to hostname resolution if interface resolution fails.
When resolving addresses, there is already a fallback to getaddrinfo when interface resolution fails. When allow_dns is set to false, the AI_NUMERICHOST flag is added to getaddrinfo to disable hostname resolution. The fact we are binding is currently used to disable hostname resolution in TCP and UDP. To enable the fallback to hostname resolution, the allow_dns option should be set to true in all cases.