10 Windows LAN Repair Commands

Essential network troubleshooting utilities built into Windows

Covers Windows 10 / 11 • Run as Administrator for full functionality

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.

01 Show all LAN adapter details
ipconfig /all

Displays 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.

02 Drop current DHCP lease
ipconfig /release

Forces 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.

03 Request a fresh IP lease
ipconfig /renew

Contacts 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.

04 Clear DNS cache
ipconfig /flushdns

Empties 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.

05 Test LAN connectivity
ping 192.168.1.1 -t

Sends 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.

06 Trace packet path across network
tracert 8.8.8.8

Shows 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.

07 View active LAN connections and ports
netstat -a

Lists 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.

08 Display ARP table (IP to MAC mapping)
arp -a

Shows 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.

09 Reset TCP/IP stack to default values
netsh int ip reset

Resets 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.

10 Lookup a host name for DNS legitimacy
nslookup google.com

Queries 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:

  • Inspectipconfig /all to see the current state
  • Refresh/release → /renew → /flushdns to reset the IP layer
  • Testping the gateway, then an external host like 8.8.8.8
  • Tracetracert if pings fail beyond the gateway
  • Resetnetsh int ip reset as a last resort before rebooting