-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use socket.getaddrinfo instead of socket.gethostbyname
socket.gethostbyname only returns a single IPv4 address. Any additional IPv4 addresses and all IPv6 addresses are ignored. As a consequence, hosts without IPv4 addresses are ignored and any additional information from additional IPv4 addresses is ignored. If IPv4 addresses are rotated by the implementation of socket.gethostbyname, for example, common with DNS servers and resolvers, the geolocation information for the host can change without every call of socket.gethostbyname. It seems better to consider all addresses, both all IPv4 and IPv6 addresses, and to summarize the geolocation information when only a single result is required. Signed-off-by: Matthias-Christian Ott <[email protected]>
- Loading branch information
Showing
2 changed files
with
87 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters