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
- Open Command Prompt (standard user rights usually sufficient).
- Type
nbtstat -Rand press Enter. - The command executes silently (no output means success).
Important:
- The
-Rparameter is case-sensitive and must be uppercase nbtstat -r(lowercase) displays different information (name resolution statistics)
Tips and Best Practices
- Use uppercase
-Rfor 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
Related nbtstat Commands
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:
-
Flush DNS cache:
ipconfig /flushdns -
Purge NetBIOS name cache:
nbtstat -R -
Release NetBIOS names:
nbtstat -RR -
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 -cbefore 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
-Rinstead.
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:
- Open Network Connections
- Right-click adapter > Properties
- Select "Internet Protocol Version 4 (TCP/IPv4)" > Properties
- Click "Advanced" > "WINS" tab
- 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:
- Local hosts file
- DNS
- LLMNR (Link-Local Multicast Name Resolution)
- NetBIOS (if enabled)
Related Tools
ipconfig /flushdns- Clear DNS cachenslookup- Query DNS serversping -a <IP>- Resolve IP to namenet view- View shared resources on networknet use- Connect to network sharesGet-NetNeighbor(PowerShell) - View neighbor cache