Im using RMI on Win95, and the Naming.lookup() call is taking a long time, even for localhost. How do I fix it?
(See also the first answer in next section below, and note that this Windows workaround has never worked for some people). Try adding a definition for the machine in your “hosts” file. Typically, this file will be named c:\windows\hosts (if it doesn’t exist, there should be a file called c:\windows\hosts.sam). The hosts file is searched by your TCP/IP stack before it resorts to DNS, so adding an entry in this file can speed up your lookups considerably. The hosts file is used to map IP addresses to symbolic addresses. To enter the name “localhost” with address 127.0.0.1 (the IP loopback address), enter the following line in your hosts file. 127.0.0.