10 Windows LAN Repair Commands
Essential network troubleshooting utilities built into Windows
When your LAN connection goes down, these ten built-in Windows commands can diagnose and fix most common problems — from release/renew of IP leases to resetting the entire TCP/IP stack. Open Command Prompt or PowerShell as Administrator and run them in order.
ipconfig /allDisplays full configuration for every network interface — IP address, subnet mask, default gateway, DHCP server, DNS servers, and physical MAC address. The first go-to command for any LAN issue; reveals whether your machine has an APIPA address (169.254.x.x) or a valid lease.
ipconfig /releaseForces the DHCP client to relinquish its current IP lease, setting all adapter addresses to 0.0.0.0. Run this before ipconfig /renew when you need a fresh IP assignment — essential when dealing with stale or conflicting leases.
ipconfig /renewContacts the DHCP server to obtain a brand-new IP lease for every adapter. Always run /release first. If renewal fails or returns an APIPA address, the DHCP server may be unreachable or the physical connection has a fault.
ipconfig /flushdnsEmpties the local DNS resolver cache. Stale or poisoned DNS entries can prevent name resolution even when the network is healthy. Flush and then test with ping google.com to verify DNS is working.
ping 192.168.1.1 -tSends ICMP echo requests to a target host. Ping your default gateway first to isolate the problem: success means your local network is fine, failure points to a cable, switch, or driver issue. The -t flag pings continuously until stopped with Ctrl+C.
tracert 8.8.8.8Shows every router hop between your machine and the destination. Use tracert to pinpoint exactly where packets are being dropped or delayed on the LAN or WAN — invaluable for identifying faulty switches, misconfigured routers, or ISP problems.
netstat -aLists all active TCP and UDP connections with their listening ports and current state (ESTABLISHED, LISTENING, TIME_WAIT). Great for verifying that a local service is bound to the correct interface or spotting unexpected connections.
arp -aShows the ARP cache — a table of IP addresses mapped to their corresponding MAC addresses on the local subnet. Use this to detect duplicate IP assignments, verify neighbor reachability, or clear stale entries with arp -d.
netsh int ip resetResets the entire TCP/IP stack to its default state. This writes two registry keys — useful when Winsock or TCP/IP parameters have been corrupted by malware, misconfiguration, or failed VPN connections. Requires a reboot to take full effect.
nslookup google.comQueries the configured DNS server and returns the IP address(es) for a given hostname. Compare the result against known-good IPs to detect DNS hijacking or misconfiguration. Use nslookup with your internal domain to verify LAN DNS resolution.
Pro Tip
Run these commands in sequence as a complete LAN diagnostics routine:
- Inspect —
ipconfig /allto see the current state - Refresh —
/release → /renew → /flushdnsto reset the IP layer - Test —
pingthe gateway, then an external host like8.8.8.8 - Trace —
tracertif pings fail beyond the gateway - Reset —
netsh int ip resetas a last resort before rebooting