I've got a few questions about name resolution and the order that
it occurs. It was my understanding that the pc checks the local
hosts (or should that be lmhosts) file first and then WINS server,
then DNS server. Is this correct?
It depends on what you are doing. You must consider Microsoft
Networking (ie NetBT or NetBios over TCP/IP) apart from raw TCP/IP
applications like web browsers, email servers/clients, and the like.
"WINS" and "lmhosts" applies only to NetBT. "DNS" and "HOSTS"
applies to TCP/IP.
Assuming that you are talking about NetBT, then a name is resolved
as follows:
1) Local Name Cache
2) WINS server
3) secondary WINS
4) Name query Broadcast on local subnet
5) LMHOSTS
6) DNS
If you are talking a TCP/IP application, you can omit steps 1-5
above.
What happens if the WINS and DNS servers cannot be found?
see above. Microsoft networking cannot "see" past routers without
WINS/lmhosts; so as long as a client is on the same subnet, the "name
query broadcast" will probably find it.
In a small peer-to-peer network all the pc's resolve the
names of the others themselves (don't they). So why do we
need WINS?
If the entire network consists of a single subnet, WINS is not
needed. If I randomly plug my laptop into a DHCP network, there is
no way for someone on a different subnet (using Microsoft
Networking) to find my laptop on the network. With WINS, my laptop
will register itself with the WINS server as soon as I plug it in
and others can query the WINS server to find my laptop on the
network.
I know DNS has now replaced it but I'm working on a LAN
that has NT4 and WINS.
I don't believe DNS has totally replaced it. DNS is used for TCP/IP
resolution and is a last resort when all else fails for Microsoft
networking. Unless my laptop can somehow register with a [dynamic]
DNS when it is DHCP-assigned an address (and everyone else on the
network knows how to turn that name into a fully-qualified domain
name), nobody will know where I am on the network.
For more info:
<
http://www.microsoft.com/ntserver/techresources/commnet/wins/winswp98.asp>
HTH,
John