What do WINS and DNS do?

Windows NT 3.5 offered the Windows Internet Name Service (WINS). Most of us had 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, but incompatible: the Domain Name System (DNS).

What is WINS, and, well, why isn't it DNS? The short answer is that WINS and DNS have somewhat different jobs. Consider the two following commands, 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 use command 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 a TCP/IP protocol stack. On any of these platforms, you can issue a ping only if you're running TCP/IP. The command's syntax is the same on every OS, but the response varies from platform to platform. For example, when the command is successful, many UNIX implementations of ping return the message, "server01.bigfirm.com is alive" (UC Berkeley used to have a machine named Elvis, so you could type 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 networking command 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 a UNIX, VMS, Mac, or other machine. Microsoft networking is designed to work on PCs and machines built on the MIPS, PowerPC, and Alpha chip sets.

The difference between ping and net use goes back to the network API that each command is based on. The ping command is based on the TCP/IP Sockets interface--actually, on the common PC implementation of TCP/IP Sockets, the Winsock interface. Basing ping on Sockets was a good idea, because this approach makes creating a ping for any OS simple, as long as the computer has a Sockets interface. In fact, people use basically the same source code to create ping for PCs, UNIX machines, VMS machines, and Macs.

The server01.bigfirm.com reference is to a DNS name, so for ping to recognize server01.bigfirm.com, you need a DNS name resolver (a DNS server) on your network. The ping command works only with IP addresses, not names; ping must know that server01.bigfirm.com is at IP address 212.33.14.88. Translating from the human-friendly name server01.big firm.com to the ping-friendly 212.33.14.88 is Winsock's job, and it calls on DNS to help. That need for two types of address is why NT 4.0 has a DNS server--to handle name resolution for Winsock-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 IBM invented in the mid-1980s. The original NetBIOS protocol no longer exists: It has mutated into the NetBEUI protocol. Because existing networking programs were built under the assumption that NetBIOS would continue to be around, NetBEUI retained NetBIOS as its programming interface.

By the way, when you read network documentation, remember that NetBEUI is the network protocol and NetBIOS is the network programming interface that first appeared on NetBEUI. Although I'm drawing my examples from the net commands, they're not the only important programs built on NetBEUI. The Microsoft File Server System and Network Neighborhood are examples of two applications that won't work on a computer that doesn't have NetBIOS.

NetBEUI was Microsoft's protocol of choice until as recently as 1993, I recall Microsoft bigwig Steve Ballmer preaching that the speed of what he called JetBEUI would assure NetBEUI's eventual preeminence in the networking market. So Microsoft's networking tools have traditionally been built on NetBIOS, NetBEUI's programming interface. The net.exe program, the networking shell for Microsoft networking, cannot run unless NetBIOS is present and cannot use other programming interfaces such as Winsock. (However, Microsoft intends to eventually change that restriction: A version of net.exe called inet.exe works just like net but runs atop Winsock.)

A NetBIOS name, the computer name that you assign to a computer when you set it up, is simpler than a DNS name: NetBIOS names have only one part, and their length doesn't exceed 15 characters. NetBIOS needs name resolution just as Winsock does. That requirement means that to make net use work, you need a NetBIOS name resolver or a NetBIOS name server. That's exactly what WINS is--a NetBIOS name server.

(In NT 4.0, Microsoft muddied this situation a bit: The net command can now accept fully qualified domain names and NetBIOS names. You can issue the command netuse* \\server01.big firm.com\bigshare with either an NT 4.0 system or a Windows 95 workstation that has Windows 95 Service Pack 2 installed.)

If the difference between server01. bigfirm.com and \\server01 still doesn't seem important, think of the Winsock and NetBIOS APIs as communications devices. Telephones and the mail service are communications devices, so I'll use them 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 ping uses Winsock (the telephone) and net use uses NetBIOS (the mail). If you telephone a friend, as far as the phone is concerned, that friend's name is 707-555-2121. As far as the mail is concerned, however, the friend's name is Paul Jones, 124 Main Street, 32102. Both are perfectly valid names for your friend Paul, but they're different because different communications systems need different name types.

NetBIOS Atop TCP
But wait--if Winsock sits atop TCP and NetBIOS sits atop NetBEUI, doesn't that 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, Internet Packet eXchange (IPX)/Sequenced Packet eXchange (SPX), and TCP/IP protocols. If you've ever been a NetWare administrator and loaded the netbios application on your user machines, you know how this works. The netbios application didn't run NetBEUI on the Novell network--it just added the NetBIOS programming interface atop 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's part, but it's not. Believe it or not, the problem of implementing NetBIOS atop TCP was tackled as far back as 1987, and you'll find two Internet Requests for Comments (RFCs), 1001 and 1002, on the topic. Most PC implementations of TCP/IP do, in fact, include a NetBIOS API, so they are different from the TCP/IP you find on UNIX (for example): The UNIX TCP/IP almost certainly won't have a NetBIOS API on it but will probably have the TCP/IP Sockets API.

NetBIOS on Microsoft's implementation of TCP/IP is essential. If TCP/IP didn'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-based workstation talk to an NT server. (Instead, the closest thing you could find to do the job of net would be the Network File System. But it wouldn't replace all the 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's asking: 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 name server01.bigfirm.com. That's why the NT TCP/IP world has two name resolvers.

A blurry line? Certainly. Did you ever notice the Enable DNS for Windows Name Resolution check box in Advanced TCP/IP Configuration? If you check that box, you're telling NetBIOS, "When you need to resolve a name like \\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 a WINS server. A good DNS server could handle name resolution for both Winsock and NetBIOS.

If that's true, why not simply use DNS as the NetBIOS name resolver in Microsoft networking? I'll take that question up next month.