Hi David, thank you very much for the tip. I tried out the function in the last three hours. However, it doesn't work as expected. I tried
DnsQueryConfig(DnsConfigHostName_A, FALSE, NULL, NULL, szHostName, &ulSize);
and this gives me the local(!) host name :omg: So, the result is equal to gethostname(). Then I tried
DnsQueryConfig(DnsConfigFullHostName_A, FALSE, NULL, NULL, szHostName, &ulSize);
and it works only on those machines where the local host name (WINS entry) is equal to the DNS entry. So, I suppose that DnsQueryConfig() queries information by giving the local host name to DNS :wtf: Of course this won't work. Moreover, the function doesn't work for Win2000 although it is specified for it (I always get a "wrong parameter" error). Maybe you can tell me what I'm doing wrong? Or do you have another idea? Thank you again for your help, Marcus.