Lesson Configuring NetBIOS Name Resolution

«■ NetBIOS Name Resolution Process «■ NetBIOS Name Cache

• How to View and Release the NetBIOS Name Cache «■ Broadcasts

• How to Preload a NetBIOS Name Cache by Using an Lmhosts File

*************************** **illegal for non-trainer use* *****************************

Introduction You can use the NetBIOS name cache, WINS server, broadcast, or Lmhosts file to resolve NetBIOS names to IP addresses.

Note This lesson describes how you can use the NetBIOS cache, broadcast, and Lmhosts file to resolve host name-to-IP address mappings. For more information about how to use a WINS server to resolve host name-to-IP address mappings, see Module 7, "Resolving NetBIOS Names by Using Windows Internet Name Service (WINS)" in Course 2277 Implementing, Managing, and Maintaining a Microsoft Windows Server 2003 Network Infrastructure: Network Services.

Lesson objectives After completing this lesson, you will be able to:

■ Describe the NetBIOS name resolution process.

■ Explain what the NetBIOS name cache is.

■ View and release the NetBIOS name cache.

■ Explain what broadcasts are.

■ Explain what an Lmhosts file is.

■ Preload the NetBIOS name cache by using an Lmhosts file.

■ Configure NetBIOS name resolution.

NetBIOS Name Resolution Process

Netbios Over Tcpip

ILLEGAL FOR NON-TRAINER USE

ILLEGAL FOR NON-TRAINER USE

Definition

NetBIOS name resolution process

NetBIOS name resolution is the process of mapping a NetBIOS name to an IP address.

The NetBIOS name resolution process is configurable. The default order, in which the client is configured to query a WINS server and to use Lmhosts lookup, is as follows.

1. When an application needs to resolve a NetBIOS name to an IP address, the application searches in the NetBIOS cache for a mapping.

2. If the NetBIOS cache does not resolve the NetBIOS name to an IP address, then the WINS server is queried.

3. If the WINS server does not resolve the NetBIOS name to an IP address, then a NetBIOS name query is sent to the local network as a broadcast.

4. If the broadcast does not resolve the NetBIOS name to an IP address, then the local Lmhosts file is searched.

5. When the NetBIOS name is found, then the corresponding IP address is returned to the application.

Methods of NetBIOS name resolution

The Microsoft implementation of TCP/IP uses the NetBIOS redirector service to resolve host names to IP addresses by using the following methods. The NetBIOS redirector is the service that takes a NetBIOS query from an application or service and manages the NetBIOS resolution process.

Standard methods of resolution

NetBIOS name cache

NetBIOS name server

Local broadcast

Description

A cache storage location for resolved NetBIOS names to IP addresses. The local cache contains the NetBIOS names that the local computer has recently resolved.

A NetBIOS name server can also be a WINS server that maintains a database of NetBIOS names.

The NetBIOS name query is broadcast onto the local network.

NetBIOS Name Cache r

A NetBIOS name cache is a location in memory that stores NetBIOS names that have recently been resolved to IP addresses whether through a WINS server, broadcast, or Lmhosts file

*****************************ILLEGAL FOR NON-TRAINER USE******************************

Definition A NetBIOS name cache is a location in memory that stores NetBIOS names that have recently been resolved to IP addresses, whether through a WINS server, broadcast, or Lmhosts file. It is also a location that stores host name-to-IP address mappings that are preloaded from the Lmhosts file.

Purpose of a NetBIOS The NetBIOS name cache is the first place that the NetBIOS redirector searches name cache for an IP address to map to a NetBIOS name. NetBIOS name cache resolves IP

addresses more quickly than a WINS server, broadcast, or Lmhosts file, and it does not create network traffic.

In addition, the NetBIOS name cache can be preloaded with often-used NetBIOS name-to-IP address mappings by using the Lmhosts file.

NetBIOS name cache The NetBIOS name cache contains the NetBIOS names that the local computer has recently resolved and also the name resolution results. Name resolution is performed more quickly, because the cached results are accessed for name resolution. However, name resolution data is limited to recently resolved names.

When a user initiates a NetBIOS name query by using an application or service, such as net use, the NetBIOS name resolution process begins. The NetBIOS name cache is checked for the NetBIOS name/IP address mapping of the destination host. The NetBIOS name cache contains the most recently resolved NetBIOS names. If the NetBIOS name is not found in the cache, the client running Windows attempts to determine the IP address of the destination host by using other methods.

Note For a command, such as net use and other commands that call the Server Message Block (SMB) protocol, Windows 2000 and later can employ either direct hosting over SMB or the traditional NetBIOS over TCP/IP. If both the direct-hosted and NetBIOS over TCP/IP are enabled, then both methods are tried at the same time, and the first to respond is used. NetBIOS over TCP/IP will attempt to use NetBIOS name resolution. Direct hosting will use host name resolution.

After a NetBIOS name is resolved to an IP address, a mapping entry is made in the NetBIOS name cache and is given a refresh interval (or TTL) of 10 minutes. If the name in the NetBIOS cache is accessed within the TTL, then the TTL is reset to 10 minutes. If the TTL is reached without the name being accessed, then the mapping is removed from the NetBIOS name cache. When you view the NetBIOS name cache, the TTL displays as life in seconds.

NetBIOS names can be one of two types: Unique or Group. A Unique NetBIOS name refers to a NetBIOS service hosted on an individual computer. A Group NetBIOS name refers to a NetBIOS service hosted on a group of computers.

Example The following table illustrates examples of NetBIOS name-to-IP address mappings stored in a NetBIOS name cache. Notice that the:

■ Name includes the 16th character that identifies the service registering the NetBIOS name.

■ NetBIOS names are Unique.

■ Life shows the number of seconds remaining before the NetBIOS name is removed.

Name Type Host address Life (seconds)

Server3 <20> UNIQUE 192.168.1.156 515

Computed <20> UNIQUE 192.168.1.101 430

How to View and Release the NetBIOS Name Cache

Your instructor will demonstrate how to:

1

<• View the contents of the local computer's NetBIOS

name cache

* Release the NetBIOS name cache and reload the

#PRE-tagged entries in the local Lmhosts file

Display and view the NetBIOS name table of the local

computer

ILLEGAL FOR NON-TRAINER USE

Introduction

Nbtstat utility

Procedure for viewing the NetBIOS name cache

Procedure for releasing the NetBIOS name cache

Procedure for viewing the NetBIOS name table of the local computer

Releasing the NetBIOS name cache removes all dynamic NetBIOS name-to-IP address mappings that are stored in the NetBIOS name cache. This is helpful when you must remove incorrect mappings.

Note It is recommended that you log on with an account that has nonadministrative credentials and use the Run as command with a user account that has appropriate administrative credentials to perform this task.

The tool used to view the NetBIOS name cache is the nbtstat utility. The Nbtstat utility displays both protocol statistics and current TCP/IP connections by using NetBIOS over TCP/IP (NBT).

When Nbtstat is used without parameters, it displays Help for using the command.

To view the contents of the local computer's NetBIOS name cache:

■ In the command prompt, type nbtstat -c

To release the NetBIOS name cache and reload the #PRE-tagged entries in the local Lmhosts file:

■ In the command prompt, type nbtstat -R

To display and view the NetBIOS name table of the local computer:

■ In the command prompt, type nbtstat -n

Broadcasts f 1 Local broadcasts ate network messages, sent from a single computer, that are distributed to all other devices on the same segment of the network as the sending computer

. If the resource Is on the local network, the 2 broadcast is answered and an IP address is --- returned

If the resource is on a remote network, then the broadcast will not pass through the router

ILLEGAL FOR NON-TRAINER USE

Broadcast Fails

Broadcast Fails

The NetBIOS redirector sends out a local broadcast

. If the resource Is on the local network, the 2 broadcast is answered and an IP address is --- returned

If the resource is on a remote network, then the broadcast will not pass through the router

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ

Definition

Purpose of broadcasts

Broadcast

ILLEGAL FOR NON-TRAINER USE

Local broadcasts are network messages, sent from a single computer, that are distributed to all other devices on the same segment of the network as the sending computer.

If the NetBIOS name is not resolved by the NetBIOS cache or by the WINS server, then the NetBIOS redirector sends a NetBIOS broadcast. Unlike an Lmhosts file, the administrator does not need to configure a NetBIOS broadcast

A NetBIOS client can issue on the local network a broadcast for the IP address of the destination NetBIOS name. The host that owns the NetBIOS name replies with its IP address, and the host that initiated the broadcast can then connect to the host that owns the NetBIOS name.

Note You can reduce broadcast traffic by using a WINS server rather than local broadcasts to resolve NetBIOS name resolution. In addition, routers are not normally configured to forward NetBIOS broadcasts, which limit NetBIOS name resolution to a single network.

Example The NetBIOS redirector sends out a local broadcast. If the resource is on the local network, then the broadcast is answered and an IP address is returned. If the resource is on a remote network, then the broadcast will not pass through a router. Therefore, the query will fail and an IP address will not be returned.

Lmhosts File

An Lmhosts file is a local text file that maps NetBIOS names to IP addresses for hosts that are not located on the local subnet

ft Copyright (c) 1983-1399 Mlcrosofl Corp. #

ft This is a sample LMHOSTS tie used by the Microsoft TCP/IP for Windows. #

S This file conlalns Ihe mappings of IP addresses to compnternames ft (NetBIOS) names. Each entry should be kepi on an individual line If The IP address should be placed In theftst column followed by the

# corresponding comptftername. The address and Ihe computemame

# should be separated by at least one space or lab. The'#' character

# Is generally used to denote the slot of a comment (see the exceptions

# The following example illustrates all ol these extensions

S102.54.94.97 rhino #PR E #DOM: networking » 102.54.94.102 'appname »iff #102.54.94.123 popular ffPRE

S 102 54.94 117 localsrv SPRE

8 #8EGIN ALTERNATE

# SINCLUDE UlocafsnApiJblicllmhosIs

# fHNCL UD E HrhmolpublicUnl hosts ft SEND ALTERNATE

Snet group's DC ff special app server #source server »needed for the include

ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ

ILLEGAL FOR NON-TRAINER USE

Definition An Lmhosts file is a local text file that maps NetBIOS names (commonly used for computer names) to IP addresses for hosts that are not located on the local subnet.

The Lmhosts file is a static file on the local computer that can aid in the resolving of a NetBIOS name. You can add NetBIOS-to-IP address mappings to the file to support NetBIOS name resolution. You can also preload into the NetBIOS name cache any mappings that you choose.

Lmhosts file The Lmhosts file can be configured to be read by Microsoft clients after a broadcast has been sent attempting to resolve a NetBIOS name on the same subnet as the resolving computer. Only if the broadcast does not return an IP address will the Lmhosts file be read. The Lmhosts file is a static ASCII text file that is used to resolve the NetBIOS names of remote NetBIOS-based computers. The Lmhosts file has the following characteristics:

■ A single entry consists of one NetBIOS name and its corresponding IP address. The entry must match the NetBIOS name of the target computers or an alias will fail.

■ An Lmhosts file must reside on each computer.

■ The default directory location of the Lmhosts file is in the %Systemroot%\System32\Drivers\Etc\ folder and has the extension of .sam. The .sam extension must be removed for the file to be read.

■ Those entries in the Lmhosts file with the #PRE keyword will be preloaded into the NetBIOS name cache. The NetBIOS name mappings with the #PRE keyword will remain in the NetBIOS cache until the mappings with the #PRE keyword are removed from the Lmhosts file.

Purpose of the Lmhosts file

Predefined keywords

An Lmhosts file contains predefined keywords that enable you to manage the mappings in the Lmhosts file. Each of the predefined keywords is prefixed with a hash symbol (#). The following table lists the possible Lmhosts keywords.

Predefined keyword

#PRE

#DOM:[domain_name]

#BEGIN_ALTERNATE #END ALTERNATE

#INCLUDE

Description

Defines which entries must be initially preloaded as permanent entries in the name cache. Preloaded entries reduce network broadcasts, because names are resolved from the cache rather than by broadcast or by searching the Lmhosts file. Entries with a #PRE tag are loaded either automatically at initialization or manually by typing nbtstat -R at a command prompt.

Facilitates domain activity, such as logon validation over a router, account synchronization, and browsing.

Defines a redundant list of alternate locations for Lmhosts files. The recommended way to include remote files is by using a universal naming convention (UNC) path, to ensure access to the file. The UNC names, with a proper IP address to NetBIOS name translation, must exist in the Lmhosts file

Loads and searches NetBIOS entries in a separate file from the default Lmhosts file. Typically, a #INCLUDE file is a centrally located and shared Lmhosts file.

Note The NetBIOS name cache and file are always read sequentially. Add the most frequently accessed computers to the top of the list. Add the entries tagged with #PRE near the bottom, because they will not be accessed again after TCP/IP initializes. For more information about the Lmhosts file, read the instructions in the Lmhosts file or see the Windows Server 2003 Help documentation.

Example The illustration is shows you the contents of an Lmhosts file. This sample

Lmhosts file can be found in the %Sysfemroo?%\System32\Drivers\Etc\ folder and is named Lmhosts.

How to Preload NetBIOS Name Cache by Using an Lmhosts File

Your instructor will demonstrate how to preload a NetBIOS name cache by using an Lmhosts file

ILLEGAL FOR NON-TRAINER USE

Introduction Guideline

You can use the Lmhosts file to preload NetBIOS name-to-IP address mappings into the NetBIOS name cache.

You must rename the file from Lmhosts.sam to Lmhosts. The NetBIOS redirector will search for a file named Lmhosts, rather than a file named Lmhosts.sam.

Note It is recommended that you log on with an account that has nonadministrative credentials and use the Run as command with a user account that has appropriate administrative credentials to perform this task.

To edit the Lmhosts.sam file from a command prompt, first open the command prompt with Run as by using a user account that has the appropriate administrative rights. Then, in the command prompt, type notepad %systemroot%\system32\drivers\etc\lmhosts.sam

Remember to save the file without the .sam extension as Lmhosts.

Procedure To preload the NetBIOS name cache by using an Lmhosts file:

1. In the Run dialog box, type the following command: notepad %systemroot%\system32\drivers\etc\lmhosts.sam

2. The Lmhosts.sam file opens for editing in Notepad.

3. In the Lmhosts file, add additional NetBIOS name-to-address mappings on separate lines. Remember to follow the format of the example in the Lmhosts file.

4. At the end of the NetBIOS name-to-IP address mapping entry, type the #PRE keyword to load the entry into the NetBIOS name cache.

5. On the File menu, click Save As.

6. In the Save As dialog box, in the Save as type field, select All Files, and then, in the File name field, type "lmhosts" (Remember to type the quotation marks. Using the quotation marks allows you to save the file without an extension.)

• It is very important that you save the file as Lmhosts and not as Lmhosts.txt.

7. Exit Notepad.

8. In Windows Explorer, in the Folder Options dialog box, on the View tab, select Hide extensions for known file types.

Practice: Configuring NetBIOS Name Resolution

In this practice, you will configure NetBIOS name resolution

Objective Instructions

Scenario

Practice

ILLEGAL FOR NON-TRAINER USE

In this practice, you will configure NetBIOS name resolution.

To complete this practice, refer to the Implementation Plan Values document, located in the Appendix at the end of your student workbook.

You must be logged on with an account that has non-administrative credentials and use the Run as command with a user account that has appropriate administrative credentials to complete the task.

The Lab department is renovating its facilities, during which time the WINS servers will be offline for a period of time. To support NetBIOS name resolution, the correct entries in the Lmhosts file need to be configured for each lab computer. You will add the NetBIOS name-to-IP address mappings to the Lmhosts file to support NetBIOS name resolution while the WINS servers are offline.

► View the NetBIOS name cache

Complete this procedure from both student computers.

• Verify that the NetBIOS name cache does not contain an entry for the Glasgow computer.

► Preload a NetBIOS name cache by using an Lmhosts file

Complete this procedure from both student computers.

■ Open a command prompt by using Run as.

■ Username: ComputerNameAdmin (where ComputerName is the name of your computer)

■ Edit the file by using the following command in the command prompt: Notepad C:\windows\system32\drivers\etc\lmhosts.sam

■ Add the following entry to the Lmhosts file (where x is the classroom number).

IP address Host name Predefined keyword

192.168.x. 100 Glasgow #PRE

■ Save the Lmhosts file without the .sam extension.

► Release the NetBIOS name cache and reload from the Lmhosts file

Complete this procedure from both student computers.

■ Open a command prompt by using Run as.

■ Username: ComputerName Admin

► View the NetBIOS name cache

Complete this procedure from both student computers.

• Verify that the NetBIOS name cache contains an entry for the Glasgow computer.

Was this article helpful?

+2 0
12 SEO Myths Busted

12 SEO Myths Busted

Within this guide you will find 12 cold, bitter truths about search engine optimization myths that have been busted. This is a common myth that is fed to new website owners as a quick way to get backlinks and traffic. If youve got a new site, the best thing to do is to find a lot of related blogs and post comments, right? Wrong. Most, if not all, blogs have nofollow tags within their code. Nofollow tags will stop the page rank and SEO from one blog from going into the other.

Get My Free Ebook


Responses

  • Demetria
    How to configure netbios name?
    1 year ago
  • sagramor clayhanger
    What is the time to life on a Netbios alias?
    12 months ago
  • HENRY
    How can you view the NetBIOS cache on a computer?
    11 months ago
  • sara
    Is the NETBIOS name COMPUTERS 16BRIAN Valid why orcwhy not?
    7 months ago
  • Ashleigh
    What is netbios process?
    7 months ago

Post a comment