gethostbyname(my_name) and IL2-Sturmovik

Juan Lang juan_lang at
Tue Dec 13 13:14:59 CST 2005

Hi Pavel,

> And on the other side, try to query a DNS server for "localhost".
> Every DNS server should immediately return, it's RFC
> compliance requirement.

Just to be clear, we're not talking about gethostbyname("localhost"). 
We're talking about gethostbyname(the_name_of_my_machine).  In Windows,
this returns your external address.  See the following sample code which
demonstrates this:

On Linux, at least for me, I get only for my hostname (juandell,
when I'm running on this laptop.)  If I were to have this name registered
with DNS, and if I were to ask a DNS server for the address of it, I
wouldn't get, of course.

But we're not talking about DNS anyway.  We're talking about winsock's
gethostbyname function.  Wine's implementation isn't correct, since it
doesn't match Windows.  I still think David's patch could use some work,
but let's not argue about whether its behaviour is correct: matching
Windows is what we're obliged to do.


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the wine-devel mailing list