in reply to Re^4: gethostbyname returns reverse order of ipaddress expected
in thread gethostbyname returns reverse order of ipaddress expected

all perl does is call the system gethostbyname and returns the results, it doesn't reorder them; if the results don't match whatever C# does, if it doesn't match your expectations, doesn't mean the results are wrong

  • Comment on Re^5: gethostbyname returns reverse order of ipaddress expected

Replies are listed 'Best First'.
Re^6: gethostbyname returns reverse order of ipaddress expected
by anubhavd (Initiate) on Jun 26, 2013 at 19:11 UTC
    You are right. .NET gethostbyname actually calls getaddrinfo in some cases. getaddrinfo returns the addresses in "correct" order which gethostbyname does not on Windows. Hence the discrepancy. tried a native app which calls both and confirmed the difference. Thanks everyone.