Use an LMHOSTS file to control which domain controller logs on your users and network machine
In October 1998, I attended the Microsoft Professional Developers Conference and the Networld+Interop conference. I always enjoy these types of events because they let me meet lots of Windows NT Magazine readers. An attendee of one of the October events asked me a question I'd heard before: "Can I control which domain controller logs my users on?" This question is a good one, and the answer is yesif you're using NT machines.
Long-Distance Relationship
To envision a situation in which specifying a user's domain controller would be useful, consider an imaginary firm that uses NT. The business has headquarters in Chicago, Illinois, and a branch office in Galway, Ireland. The company has 200 people and two domain controllers in Galway and 1000 people and six domain controllers in Chicago, with a couple of 64Kbps frame relay connections linking the two sites. To make the example simple, I'll say the company uses only one domain.
At 8:00 a.m. Central time each day, all the company's Chicago users power up and log on. Some users' logons are sluggish, and those same users experience slowness in other operations, such as browsing Network Neighborhood. However, when the users reboot their systems later in the day, the sluggishness disappears.
What is the users' problem? Network sluggishness and the reboot fix are symptoms of many problems, but most likely, the users' NT machines have attached to an Irish domain controller across one of the company's 64Kbps links.
| LMHOSTS is a blessing in scenarios in which trust links between two domains are constantly breaking. |
To find a domain controller, an NT system asks the local Windows Internet Naming Service (WINS) server for a list of all the domain controllers that it knows about. While it's waiting for the WINS server to respond, the computer broadcasts a request to be logged on, essentially shouting to the network, If a domain controller receives this message, it needs to log me on! NT machines always send a broadcast message when they log on. This practice increases the probability that local domain controllers log on NT computers. (For information about NetBIOS names and name resolution, see "Inside a NetBIOS Name Resolution," March 1997.)
The WINS server that the NT machine contacts delivers a list of up to 25 of that domain's domain controllersWINS remembers only the past 25 domain controllers it has heard of. The workstation sends an invitation to each domain controller on the WINS server's list, asking the domain controllers to log it on. The first domain controller that responds to the NT machine's many logon requests logs the computer on.
So why might Galway's domain controllers, which the Chicago machines connect to via the slow WAN link, respond more quickly than the Chicago domain controllers to the logon request? Well, at 8:00 a.m., everyone in Chicago is trying to log on, so the Chicago domain controllers are busy. In addition, the fictitious firm might have committed the common error of running WINS server software on its domain controllers. This practice is unwise because WINS servers and Primary Domain Controllers (PDCs) are both busiest at the start of the day. Every system on the network is logging onwhich keeps the PDCs busyand simultaneously registering its name with WINSwhich keeps the WINS servers busy. Early morning is a rough time for PDCs that double as WINS servers.
In contrast to the Chicago PDCs, which at 8:00 a.m. are trying to log on 1000 users at the same time, Galway's machines are loafing along, responding to occasional authentication requests, because in Ireland it's 2:00 p.m. When these machines receive a cry for help across the WAN, they respondand they respond quickly compared with the overloaded Chicago PDCs. The result of this scenario is that some Chicago NT workstations (or even Chicago NT servers, because some firms reboot their servers every week or so) now look to machines thousands of miles away for their authentications. When users sit down at their machine and type their name, password, and domain name, their workstation verifies their user account with a computer across the Atlantic. The users receive rotten response times, and folks in Galway who are trying to access Chicago servers across the WAN link experience delays because the unnecessary authentication traffic is choking the transatlantic link.