Name Resolvers: WINS vs. DNS
What's in a name? WINS and DNS read names differently, that's what. Check out the subtle differences.
October 31, 1996
What do WINS and DNS do?
Windows NT 3.5 offered the Windows Internet Name Service (WINS). Most of ushad no idea what it did, but we soon figured out that we pretty much needed it.The rest of the Internet world seemed to be using something similar, butincompatible: the Domain Name System (DNS).
What is WINS, and, well, why isn't it DNS? The short answeris that WINS and DNS have somewhat different jobs. Consider the two followingcommands, both issued to the same server:
ping server01.bigfirm.com and net use * \server01 mainshr
The ping command refers to the server as server01.big firm.com. The net usecommand calls the same server server01. The difference is important.
Why Two Different Names?
The ping command is a platform-independent, TCP/IP/Internet kind of command.It's valid on UNIX, VMS, Macintosh, and MVS--so long as the machine is running aTCP/IP protocol stack. On any of these platforms, you can issue a ping only ifyou're running TCP/IP. The command's syntax is the same on every OS, but theresponse varies from platform to platform. For example, when the command issuccessful, many UNIX implementations of ping return the message, "server01.bigfirm.comis alive" (UC Berkeley used to have a machine named Elvis, so you couldtype ping Elvis and get the response, "Elvis is alive"). In contrast,Microsoft implementations of ping respond with something like, "Reply from[IP address]..."
In contrast to ping, net use is a Microsoft platform-specific networkingcommand that is independent of protocol. You can do a net use on an NT network,no matter what protocol you're running, but the command usually isn't valid on aUNIX, VMS, Mac, or other machine. Microsoft networking is designed to work onPCs and machines built on the MIPS, PowerPC, and Alpha chip sets.
The difference between ping and net use goes back to the network API thateach command is based on. The ping command is based on the TCP/IP Socketsinterface--actually, on the common PC implementation of TCP/IP Sockets, theWinsock interface. Basing ping on Sockets was a good idea, because this approachmakes creating a ping for any OS simple, as long as the computer has a Socketsinterface. In fact, people use basically the same source code to create ping forPCs, UNIX machines, VMS machines, and Macs.
The server01.bigfirm.com reference is to a DNS name, so for ping torecognize server01.bigfirm.com, you need a DNS name resolver (a DNS server) onyour network. The ping command works only with IP addresses, not names; pingmust know that server01.bigfirm.com is at IP address 212.33.14.88. Translatingfrom the human-friendly name server01.big firm.com to the ping-friendly212.33.14.88 is Winsock's job, and it calls on DNS to help. That need for twotypes of address is why NT 4.0 has a DNS server--to handle name resolution forWinsock-based programs.
net use is built on a different programming interface, the NetBIOS API.This API is based on a fairly old and simple network protocol that Sytek and IBMinvented in the mid-1980s. The original NetBIOS protocol no longer exists: Ithas mutated into the NetBEUI protocol. Because existing networking programs werebuilt under the assumption that NetBIOS would continue to be around, NetBEUIretained NetBIOS as its programming interface.
By the way, when you read network documentation, remember that NetBEUI isthe network protocol and NetBIOS is the network programming interface that firstappeared on NetBEUI. Although I'm drawing my examples from the net commands,they're not the only important programs built on NetBEUI. The Microsoft FileServer System and Network Neighborhood are examples of two applications thatwon't work on a computer that doesn't have NetBIOS.
NetBEUI was Microsoft's protocol of choice until as recently as 1993, Irecall Microsoft bigwig Steve Ballmer preaching that the speed of what he calledJetBEUI would assure NetBEUI's eventual preeminence in the networkingmarket. So Microsoft's networking tools have traditionally been built onNetBIOS, NetBEUI's programming interface. The net.exe program, the networkingshell for Microsoft networking, cannot run unless NetBIOS is present and cannotuse other programming interfaces such as Winsock. (However, Microsoft intends toeventually change that restriction: A version of net.exe called inet.exe worksjust like net but runs atop Winsock.)
A NetBIOS name, the computer name that you assign to a computer when youset it up, is simpler than a DNS name: NetBIOS names have only one part, andtheir length doesn't exceed 15 characters. NetBIOS needs name resolution just asWinsock does. That requirement means that to make net use work, you need aNetBIOS name resolver or a NetBIOS name server. That's exactly what WINS is--aNetBIOS name server.
(In NT 4.0, Microsoft muddied this situation a bit: The net command can nowaccept fully qualified domain names and NetBIOS names. You can issue the commandnetuse* \server01.big firm.combigshare with either an NT 4.0 system or aWindows 95 workstation that has Windows 95 Service Pack 2 installed.)
If the difference between server01. bigfirm.com and \server01 stilldoesn't seem important, think of the Winsock and NetBIOS APIs as communicationsdevices. Telephones and the mail service are communications devices, so I'll usethem in an analogy. Think of Winsock as the phone and NetBIOS as surface mail.The job of both ping and net use is to communicate with some other PC, but pinguses Winsock (the telephone) and net use uses NetBIOS (the mail). If youtelephone a friend, as far as the phone is concerned, that friend's name is707-555-2121. As far as the mail is concerned, however, the friend's name isPaul Jones, 124 Main Street, 32102. Both are perfectly valid names for yourfriend Paul, but they're different because different communications systems needdifferent name types.
NetBIOS Atop TCP
But wait--if Winsock sits atop TCP and NetBIOS sits atop NetBEUI, doesn'tthat mean that you must run NetBEUI to do things such as net use? No,thank goodness. The NetBIOS API is implemented on Microsoft's NetBEUI, InternetPacket eXchange (IPX)/Sequenced Packet eXchange (SPX), and TCP/IP protocols. Ifyou've ever been a NetWare administrator and loaded the netbios application onyour user machines, you know how this works. The netbios application didn't runNetBEUI on the Novell network--it just added the NetBIOS programming interfaceatop the network protocol that the Novell network used: IPX/SPX, in most cases.
Putting NetBIOS atop TCP/IP sounds like a radical approach on Microsoft'spart, but it's not. Believe it or not, the problem of implementing NetBIOS atopTCP was tackled as far back as 1987, and you'll find two Internet Requests forComments (RFCs), 1001 and 1002, on the topic. Most PC implementations of TCP/IPdo, in fact, include a NetBIOS API, so they are different from the TCP/IP youfind on UNIX (for example): The UNIX TCP/IP almost certainly won't have aNetBIOS API on it but will probably have the TCP/IP Sockets API.
NetBIOS on Microsoft's implementation of TCP/IP is essential. If TCP/IPdidn't have a NetBIOS API on it, you couldn't use the net use, net view,net logon, and similar commands and Network Neighborhood to let your PC-basedworkstation talk to an NT server. (Instead, the closest thing you could find todo the job of net would be the Network File System. But it wouldn't replace allthe functions of net.) Microsoft's NetBIOS on TCP/IP even has a name--NBT.
Who's Asking?
So the server in my example has two names, depending on who'sasking: To Winsock, the name is server01.big firm.com; to NetBIOS, the name is\server01. DNS resolves names for Winsock, and WINS resolves names for NetBIOS.DNS can't resolve the name \server01, and WINS can't resolve the nameserver01.bigfirm.com. That's why the NT TCP/IP world has two nameresolvers.
A blurry line? Certainly. Did you ever notice the Enable DNS forWindows Name Resolution check box in Advanced TCP/IP Configuration? If youcheck that box, you're telling NetBIOS, "When you need to resolve a namelike \server01 into an IP address, ask the DNS server whether it can help you."In theory, then, you could run your TCP/IP-based Microsoft network without aWINS server. A good DNS server could handle name resolution for both Winsockand NetBIOS.
If that's true, why not simply use DNS as the NetBIOS name resolver inMicrosoft networking? I'll take that question up next month.
About the Author
You May Also Like