Sender: richdawe AT bigfoot DOT com Message-ID: <373EF59A.C50A0C31@bigfoot.com> Date: Sun, 16 May 1999 17:43:06 +0100 From: Richard Dawe X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.1 i586) MIME-Version: 1.0 To: DJGPP workers Subject: Re: $HOSTNAME doesn't override library code References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hello. Eli Zaretskii wrote: > I think if libsocket is used it should override gethostname by a > DNS-aware version. I understand that there's no way to get this > information without talking to Winsock. The following is Windows '9x specific: Unless a DNS server is used, the name defaults to the same as the LAN manager name. If a DNS server is used, then a name is provided in the networking control panel. This gets stored in the following registry key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP libsocket uses the Regdos Group's registry code to get this value. I think this key will only be created by Microsoft TCP/IP stacks. No communication with Winsock is necessary. If DHCP is being used, then it gets a bit more complicated. I've documented where the host name, etc., is found here: http://www.geocities.com/SiliconValley/Lab/3216/dl/winnetip.htm BTW the user name gets stored in: HKEY_LOCAL_MACHINE\Network\Logon > If it bothers you, I could try to remove you from the default > addressees. I think I can cope with it ;)