Back to docs
Tools - NetworkUpdated: November 23, 2024

nbtstat -R

Clear and reload the NetBIOS name cache for fixing network name issues.

nbtstat -R

Command: nbtstat -R

Category: Network

Type: CMD

Purpose

Purges and reloads the NetBIOS name cache. This command clears all entries from the cache and then reloads them from the LMHOSTS file (if configured). Useful for fixing network name resolution issues, especially in legacy Windows networks or mixed environments.

Quick Summary

Clear stale NetBIOS names and force Windows to rebuild its NetBIOS name cache. When computers can't find each other by name on the network, or when network names point to wrong IP addresses, this command forces a fresh start. Essential for legacy network troubleshooting and NetBIOS name resolution issues.

How to Use

  1. Open Command Prompt (standard user rights usually sufficient).
  2. Type nbtstat -R and press Enter.
  3. The command executes silently (no output means success).

Important:

  • The -R parameter is case-sensitive and must be uppercase
  • nbtstat -r (lowercase) displays different information (name resolution statistics)

Tips and Best Practices

  • Use uppercase -R for purging: nbtstat -R
  • Run after modifying the LMHOSTS file to apply changes immediately.
  • Combine with DNS flush for comprehensive name resolution reset.
  • Safe to run anytime; won't cause network disruptions.
  • May need to wait a few seconds for cache to fully rebuild.
  • If problems persist, check LMHOSTS file or DNS configuration.

Common Use Cases

  • Computer name resolution fails: Can't connect to other computers by name on local network.
  • Stale NetBIOS entries: Names point to old or incorrect IP addresses.
  • After LMHOSTS modifications: Apply changes made to the LMHOSTS file.
  • Network troubleshooting: Part of comprehensive network name resolution troubleshooting.
  • Mixed Windows environments: Resolve issues in networks with both old and new Windows versions.
  • Legacy application support: Fix name resolution for older applications relying on NetBIOS.

Prerequisites

  • Windows Command Prompt or PowerShell
  • Usually no administrator rights required (may vary by system configuration)
  • Available on all Windows versions
  • NetBIOS over TCP/IP must be enabled on network adapter

Understanding NetBIOS Names

NetBIOS (Network Basic Input/Output System):

  • Legacy networking protocol used by older Windows systems
  • Allows computers to communicate using simple names (up to 15 characters)
  • Still used for backwards compatibility and some network browsing features
  • Modern networks primarily use DNS, but NetBIOS coexists for compatibility

When NetBIOS is Used:

  • Browsing network computers in File Explorer
  • Accessing shares by computer name: \\COMPUTERNAME\Share
  • Legacy applications requiring NetBIOS name resolution
  • Networks without proper DNS configuration

View current NetBIOS name cache:

nbtstat -c

Purge and reload cache (what we're discussing):

nbtstat -R

View name resolution statistics (lowercase r):

nbtstat -r

Display local NetBIOS name table:

nbtstat -n

Display all NetBIOS information:

nbtstat -A <IP address>
nbtstat -a <computer name>

Release and refresh NetBIOS names:

nbtstat -RR

Complete Network Name Resolution Reset

For comprehensive troubleshooting, perform these in sequence:

  1. Flush DNS cache:

    ipconfig /flushdns
    
  2. Purge NetBIOS name cache:

    nbtstat -R
    
  3. Release NetBIOS names:

    nbtstat -RR
    
  4. Restart network adapter (optional):

    ipconfig /release
    ipconfig /renew
    

Troubleshooting

  • "Failed to purge the NBT Remote Cache Table" - Usually due to NetBIOS over TCP/IP being disabled; enable in network adapter properties.
  • Command appears to do nothing - Normal; no output means success. Check with nbtstat -c before and after.
  • Still can't resolve names - Problem may be DNS, network configuration, or firewall; verify with ping COMPUTERNAME.
  • Used lowercase -r by mistake - Shows statistics instead of purging; use uppercase -R instead.

LMHOSTS File

Location:

C:\Windows\System32\drivers\etc\lmhosts

Purpose:

  • Maps NetBIOS names to IP addresses
  • Similar to hosts file but for NetBIOS names
  • Reloaded when you run nbtstat -R

Sample entry:

192.168.1.100    SERVER01    #PRE

The #PRE tag preloads this entry into the cache at startup.

NetBIOS Over TCP/IP Settings

Check if enabled:

  1. Open Network Connections
  2. Right-click adapter > Properties
  3. Select "Internet Protocol Version 4 (TCP/IPv4)" > Properties
  4. Click "Advanced" > "WINS" tab
  5. Check "NetBIOS setting"

Options:

  • Default: Use NetBIOS setting from DHCP server
  • Enable NetBIOS over TCP/IP: Always use NetBIOS
  • Disable NetBIOS over TCP/IP: Turn off NetBIOS (may break legacy compatibility)

When to Disable NetBIOS

Modern networks with proper DNS can disable NetBIOS for security:

  • Reduces attack surface
  • Eliminates potential name conflicts
  • Simplifies network configuration
  • May break legacy applications or older Windows systems

Modern Alternatives

For modern networks:

  • DNS: Primary name resolution method
  • mDNS/LLMNR: Alternative protocols for local name resolution
  • Windows Name Resolution order:
    1. Local hosts file
    2. DNS
    3. LLMNR (Link-Local Multicast Name Resolution)
    4. NetBIOS (if enabled)
  • ipconfig /flushdns - Clear DNS cache
  • nslookup - Query DNS servers
  • ping -a <IP> - Resolve IP to name
  • net view - View shared resources on network
  • net use - Connect to network shares
  • Get-NetNeighbor (PowerShell) - View neighbor cache