NBTSTAT - CMD


Overview

NBTSTAT is a Windows command-line utility used for troubleshooting NetBIOS over TCP/IP (NBT) connections. It displays protocol statistics and current TCP/IP connections using NBT (NetBIOS over TCP/IP). This command is primarily useful in diagnosing NetBIOS name resolution issues, helping network administrators manage network connectivity and troubleshoot issues in a Windows network environment.

Syntax

The general syntax for NBTSTAT is:

nbtstat [options]

The command options specify the operation to be performed. Some options can be combined for richer output or detailed diagnostics.

Options/Flags

  • -a <RemoteName>
    Lists the NetBIOS names registered by a remote machine specified by its name. This is useful for verifying the names registered on a remote machine.

  • -A <IPAddress>
    Lists the NetBIOS names registered by a remote machine specified by its IP address. Useful for resolutions where the device name is not known but the IP address is.

  • -c
    Shows the NetBIOS name cache, the table of NetBIOS names and their resolved IP addresses.

  • -n
    Displays NetBIOS names registered locally on the system. Good for verifying which names are being broadcast from the local machine.

  • -r
    Shows NetBIOS name resolution statistics, including counts of names resolved locally by broadcasting or via a WINS server.

  • -R
    Purges and reloads the remote cache name table. Useful for troubleshooting,name resolution issues.

  • -S
    Lists sessions table with destination IPs and their state. Not to be confused with session details from other tools like netstat.

  • -s
    Lists sessions table, converting destination IPs to host names via the hosts file or Domain Name System (DNS), when possible.

Examples

  1. View NetBIOS names and connection statistics:

    nbtstat -a workstation01
    
  2. Refresh the NetBIOS name cache and display the local NetBIOS names:

    nbtstat -R
    nbtstat -n
    
  3. Display NetBIOS name resolution statistics:

    nbtstat -r
    
  4. Check the remote cache entries:

    nbtstat -c
    
  5. Display session table with host names:

    nbtstat -s
    

Common Issues

  • Resolution Failure: Can occur if the target device’s NetBIOS names are not properly registered or if network issues prevent access. Ensuring proper network configuration and verifying that the target device is online and properly configured can mitigate this issue.

  • Cache Issues: Incorrect or outdated entries in the NetBIOS cache can lead to resolution issues. Using nbtstat -R can clear and reload the cache to overcome these errors.

Integration

NBTSTAT can be combined with ping or ipconfig to diagnose network connectivity and resolution issues:

ipconfig /all
nbtstat -a workstation02
ping workstation02

This sequence helps to verify both IP configuration and NetBIOS names resolution by displaying all relevant network configurations and testing connectivity.

  • NETSTAT: Display network statistics, current TCP/IP connections, and port status.
  • IPCONFIG: Display all current TCP/IP network configuration values and refresh DHCP and DNS settings.
  • PING: Check the ability to reach a network node online and measure the round-trip time for messages sent from the originating host.

For detailed NetBIOS and network troubleshooting, consider visiting the official Microsoft documentation.