Implementing the WINS Service

Archived content. No warranty is made as to technical accuracy. Content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

By Brien M. Posey, MCSE for TechRepublic.com

With Microsoft Windows 2000 just around the corner, it's important to get your network in order before upgrading. If you haven't already done so, one of the main things that you should do is configure your network to run TCP/IP. Although setting up TCP/IP is almost a necessity these days, without the proper planning it can drastically slow your network because of the broadcast traffic generated through the process of resolving computer names to IP addresses. Fortunately, Microsoft provides the WINS service to automate the name resolution process without the excessive broadcasts. In this article, we'll discuss the reasons why you should implement a WINS server. We'll also show you how to install and configure the WINS services.

On This Page

Why Use WINS?
What About Microsoft Windows 2000 Compatibility?
How Does WINS Work?
Installing WINS
Replicating WINS Databases
WINS Maintenance
Backups
When the WINS Database Gets Too Large
Conclusion

Why Use WINS?

There are two primary advantages to using the WINS service. First, before two NetBIOS-based hosts can communicate over a TCP/IP network, the NetBIOS names must be resolved to IP addresses. As we mentioned earlier, to resolve NetBIOS names without a WINS server, TCP/IP must rely on broadcast traffic. This extra broadcast traffic can cause network congestion. With a WINS server online, when a computer wants to communicate with another computer, a name query is sent directly to the WINS server. The WINS server returns the destination computer's IP address to the original computer without the need for broadcast traffic.

The second reason for using WINS is that it's dynamic. As computers attach to and detach from the network, the WINS databases are updated automatically. This means that you don't have to create a static LMHOST file that the computers can read to determine IP addresses.

What About Microsoft Windows 2000 Compatibility?

Although Microsoft Windows 2000-based clients will be able to use a WINS server, they won't require it. Microsoft Windows 2000 will replace WINS with a new service called Dynamic DNS. Dynamic DNS will dynamically resolve host names and NetBIOS names. However, Dynamic DNS will require you to run a DHCP server. Therefore, if you don't have a DHCP server, you must continue to use WINS until you add one to your network.

How Does WINS Work?

Okay, so WINS resolves NetBIOS names to IP addresses, but just knowing that simple fact isn't really enough. It's important to understand how WINS works. If you ever have problems with name resolution, you'll have a much easier time fixing the problem if you understand what's really going on.

When a WINS client comes on line, it already knows about the WINS server, because the WINS server's IP address is configured within the client's TCP/IP configuration, as shown in Figure A. Once the client knows the location of a WINS server, it registers its NetBIOS name and IP address with the WINS server.

Cc768145.winsa(en-us,TechNet.10).gif

Figure A: Each client's TCP/IP configuration points to a WINS server.

Now, suppose that the client issues a NetBIOS style command, such as NET USE Z: \\TALAINIA\C$. Rather than sending a broadcast to the entire network that's aimed at finding the server TALAINIA, the client sends the request directly to the WINS server. Since the server TALAINIA is also NetBIOS-based, it has already registered its name and IP address with the WINS server when it first came on line. When the WINS server receives the request, it queries its database for the name TALAINIA. When it finds the entry, it returns the associated IP address directly to the client that requested it.

Although this process sounds simple, there are many factors that can complicate things. For example, you may be wondering what happens if a computer tries to register a NetBIOS name that's already in use.

Keep in mind that the WINS server handles requests dynamically. The very nature of a dynamic database suggests that each computer's use of a given NetBIOS name is temporary. For example, when a client comes on line, it registers its NetBIOS name with a WINS server. When that computer is shut down, it sends another message to the WINS server indicating that the name is no longer in use. This makes it possible for another computer to use that name.

Now, suppose a computer comes on line and tries to register a NetBIOS name that's currently registered. If a duplicate name is found, the WINS server sends a challenge to the IP address of the computer that originally registered the name. If there's no response, the challenge will be sent a total of three times. If the registered owner is multihomed, the challenge will be sent to each IP address that the computer registered. If the current owner responds to the challenge, the WINS server will deny the client use of the name. Otherwise, WINS will revoke ownership of the name from the currently registered computer and grant it to the new computer.

Although WINS may sound like a great way to reduce broadcast traffic, you may be wondering what will happen to your network if the WINS server drops offline. Fortunately, your network won't come to a grinding halt. As you can see in Figure A, each WINS client can be configured to use a backup WINS server. If neither WINS server is available, the clients will begin using broadcasts to resolve name information until a WINS server becomes available.

Installing WINS

Before you begin implementing a WINS server, it's important to know how many WINS servers you'll need. First, keep in mind that WINS servers communicate through UDP packets. Therefore, WINS communications are routable. This means you won't need a separate WINS server for each segment of your network.

Each WINS server can handle about 4,500 name queries per minute. However, you can expect about a 25 percent increase in performance for each extra processor that you add to a WINS server. If you have appropriate hardware, Microsoft states that a WINS server and a backup WINS server working together can service at least 10,000 WINS clients. The WINS service must run on a Microsoft Windows NT Server with a static IP address.

To install the WINS service, first select a server with a static IP address and open Control Panel. Next, double-click on Control Panel's Network icon. When you see the Network properties sheet, click the Services tab. Then, click Add to open the Select Network Services dialog box. Next, select the Microsoft Windows Internet Name Service from the Network Service window and click OK.

At this point, Microsoft Windows NT will ask for the location of your Microsoft Windows NT Server CD. Specify the path to your installation files and click the Continue button. When Microsoft Windows NT copies the necessary files, click OK to close the Network properties sheet. Microsoft Windows NT will then update the necessary bindings and ask you to reboot the server. When the server reboots, you can configure your clients and begin using the WINS service.

Replicating WINS Databases

The WINS model we've given you works great for small to mid-sized networks. However, you may be wondering what would happen if you wanted to use WINS on a really large network. For example, suppose that you had a network in New York and a network in Los Angeles. Now suppose that both networks had their own WINS and backup WINS servers. The networks would work great as long as no one needed to perform any sort of NetBIOS communication between the two networks.

As you may recall, WINS traffic is routable. The reason that NetBIOS communication between the two networks wouldn't work is that the two networks have no knowledge of each other. All of the PCs in New York are registering with WINS servers in New York. Likewise, computers in Los Angeles are registering with WINS servers in Los Angeles. If a computer in New York wanted to communicate with a computer in Los Angeles, it would check the WINS database for the computer name. Since the computers in Los Angeles aren't registered in the database, communications would fail.

The solution to this problem is to make the two networks know about each other. This is done through database replication. This means that the WINS servers in each location can exchange information with each other.

Replication works through push and pull partners. A push partner tells the pull partner that the database has changed. The pull partner then requests all the changes from the push partner. A WINS server can be configured as both a push and a pull server. Therefore, it's possible for two servers to replicate any change that happens on one server to the other server. If the servers in New York and Los Angeles that we used in our earlier example were configured as push and pull partners, both WINS servers would have knowledge of WINS clients at both locations. You can configure replication by selecting the Replication Partners command from WINS Manager's Server menu.

WINS Maintenance

If WINS ever seems to be having trouble with a specific database entry, it's sometimes helpful to look at the actual database contents. To do so, open an MS-DOS Prompt window and run the following command (this command is case sensitive):

nbtstat –R

Doing so purges the name cache. Next, go to the Start menu and select Programs | Administrative Tools | WINS Manager. When you do, you'll see WINS Manager. Now, select the Show Database command from WINS Manager's Mappings menu. When you do, you'll see the WINS database's contents, as shown in Figure B.

Cc768145.winsb(en-us,TechNet.10).gif

Figure B: You can use WINS Manager to view the contents of the WINS database.

If you need to view specific entries, WINS Manager has a number of ways for doing so. For example, you could select the Show Only Mappings From Selected Owner option. Doing so would display database records from only the server that you've selected. You can also set the sort order to sort the database by items such as computer names or IP address. Finally, you can click the Set Filter button to search for specific information.

When you're looking at the contents of the database, each line begins with an icon. If the icon is a picture of a computer, it indicates that the entry is a unique name. If the icon shows three computers overlapping, it indicates that the computer is multihomed.

You may have also noticed the A and S columns. If there's a check in the A column, it indicates an active connection from a computer that acquired its IP address from a DHCP server. If there's a dash in the A column, it means that the connection is no longer active and will soon be removed from the database. A checkmark in the S column indicates a static IP address.

Backups

As with any other database, you need to regularly back up the WINS database. What makes backing up the WINS database nice, though, is that with the exception of the first backup, backups happen automatically.

To back up the WINS database, select the Back Up Database command from WINS Manager's Mappings menu. Next, specify a location for the backup files and click OK. WINS will then automatically back up its database every 24 hours.

Should the WINS database become corrupted, simply stop and restart the WINS service. If WINS detects the corruption, it will automatically restore the most recent backup. If WINS doesn't detect the corruption, you can force a restore by selecting the Restore Database command from WINS Manager's Mappings menu.

Although database backups are automatic, it's not a bad idea to occasionally back up the WINS section of the registry. To do so, open the Registry Editor and navigate to HKEY_LOCAL_MACHINE | SYSTEM | CURRENTCONTROLSET | SERVICES | WINS. Next, select the Save Key command from the Registry menu. In the Save Key dialog box, specify the path that you're using for WINS backup files.

When the WINS Database Gets Too Large

WINS is designed to compact its databases automatically when they become too large. However, if you think that the databases are becoming too large, you can compact them manually. To do so, open an MS-DOS Prompt window and issue the following commands:

NET STOP WINS
JETPACK WINS.MDB TEMP.MDB
NET START WINS

These commands stop the WINS service and copy the WINS database to a file called TEMP.MDB, then the TEMP.MDB file is compacted. Once the file has been compacted successfully, it's copied to WINS.MDB and the temp file is deleted. Finally, the WINS service is restarted.

Conclusion

In this article, we've explained why you need at least one WINS server if you plan to use TCP/IP. We then went on to explain how to install the WINS service, and how to perform routine maintenance on the WINS database.

Brien M. Posey is an MCSE and a freelance technical writer. He also works as a network engineer for the Department of Defense. You can contact him via e-mail at Brien_Posey@xpressions.com. (Because of the large volume of e-mail that he receives, it's impossible for him to respond to every message. However, he does read them all.)

flaglogo

We at Microsoft Corporation hope that the information in this work is valuable to you. Your use of the information contained in this work, however, is at your sole risk. All information in this work is provided "as -is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by Microsoft Corporation. Microsoft Corporation shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.