Matt Robenolt added the comment: Sorry, to add a data point, in C, `gethostbyname` also does the correct thing on macOS.
See: ``` #include <stdio.h> #include <errno.h> #include <netdb.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> int main(int argc, char *argv[]) { int i; struct hostent *lh = gethostbyname("0177.0000.0000.0001"); struct in_addr **addr_list; if (lh) { addr_list = (struct in_addr **)lh->h_addr_list; for (i=0; addr_list[i] != NULL; i++) { printf("%s", inet_ntoa(*addr_list[i])); } printf("\n"); } else { herror("gethostbyname"); } return 0; } ``` So I'm not sure this is platform specific. Either way, `socket.gethostbyname` is wrong on both linux and macOS. I'm a bit lost with what's going on here though, admittedly. :) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27612> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com