When your internet suddenly dies, it often goes without any warning. There are router settings you should check before blaming your ISP, but if the router is in order, popping open Windows Terminal can tell you very quickly whether the problem is your PC, your router, your ISP, or just DNS acting up.
Thankfully, you don’t need to be a terminal wizard to use the command line for diagnosing your internet. Some very simple commands can tell you what’s acting up in your internet stack in no time.
Start with ipconfig to check your network basics
Confirm you actually have an IP address
Tashreef Shareef / MakeUseOfCredit: Tashreef Shareef / MakeUseOf
I like starting with a simple status check. Just run ipconfig in the terminal, or ipconfig /all if you need more detail. This gives you your IP address, subnet mask, default gateway, and DNS servers, which already tells you whether your PC is even talking to the router properly. If your IPv4 address starts with something like 169.254, Windows couldn’t get an address from the router, which usually indicates a DHCP or Wi-Fi issue. If you see a normal private IP along the lines of 192.169.X.X or 10.X.X.X, but no default gateway, that’s another hint your local network configuration is off.
Running ipconfig first gives you a baseline: you know whether to focus on your network adapter, your router, or something further out on the internet. It’s also a good sanity check before you move to more destructive commands that reset network stacks.
Use ping to find where the connection fails
Test your router first
Screenshot taken by Yadullah Abidi | No attribution required.
Once I know my local IP setup, I use the ping command to check whether data packets are making it anywhere near the internet or not. Generally speaking, you can ping three things in order: your router, a public IP, and then a domain name.
For the router, the IP address is usually something like 192.168.1.1, but you can check the default gateway shown in ipconfig to know the exact address. If that fails, your problem is the local Wi-Fi, Ethernet, or the router itself.
If the router responds, try pinging a known public address like 8.8.8.8. Success here means your internet connection is working as expected. Finally, ping a domain using a command like ping google.com. If pinging the IP works, but the domain fails, you can almost bet DNS is the culprit.
Run nslookup to see if DNS is the culprit
Understand when it’s a name issue, not the internet
Screenshot uploaded by Yadullah Abidi | No attribution required.
When websites fail to load but pinging to raw IP addresses works, I use nslookup to confirm whether the DNS has a problem or not. With a simple command like nslookup makeuseof.com, Windows asks your configured DNS server to resolve that hostname and prints the IP addresses it gets back. If the command hangs or returns a timeout, your DNS server is unreachable or misbehaving. If it resolves, but your browser still won’t load sites, you might be dealing with something like a proxy, VPN issue, or browser-specific problem instead.
You can also point nslookup at specific DNS servers, for example, 8.8.8.8, to quickly check whether public DNS works better than the one your ISP or router is using. This kind of quick A/B testing can quickly help you decide whether you should stop using the default DNS on your router.
Flush the DNS cache to clear bad records
Fix sites that load on other devices but not yours
Image taken by Yadullah Abidi | No attribution required.
If nslookup suggests DNS isn’t working or you’re only having trouble with specific sites, run ipconfig /flushdns. This will clear out cached DNS responses and remove bad entries to fetch fresh ones the next time you ping a domain.
Windows caches DNS responses locally to speed up browsing, but that cache can get polluted with bad entries as sites move, ISPs change routing, or you hop between networks. The command to flush them is simple, quick, and safe, as it doesn’t touch your network adapter or router configurations. It just clears the local name-to-IP mappings. You can also pair it with a browser restart, then repeat an nslookup and a ping command to the same domain to see if resolving works correctly. If your internet comes back to life, you’ve just fixed a sneaky DNS issue without rebooting the entire system.
Reset the network stack when nothing else works
Repair broken network configurations
Screenshot uploaded by Yadullah Abidi | No attribution required.
When all else fails, and the problem clearly lives on the Windows side, it’s time for the nuclear option: resetting the entire network stack. I usually run such commands from an elevated Windows Terminal session, as they require administrator privileges to run properly.
netsh winsock reset
netsh int ip reset
Together, these commands reset Winsock, the Windows networking API layer, and rewrite key TCP/IP configuration in the registry, which has an effect similar to reinstalling the protocol. I
This is what you reach for when you’ve tried disabling and enabling the adapter, flushing DNS, and maybe even rebooting the router, and the machine still refuses to connect while other devices are fine. Keep in mind that these commands can wipe custom IP settings, so static configurations may need to be applied again. Once you run them, reboot your PC, and repeat the earlier ipconfig and ping tests to confirm your stack is clean and running.
You don’t need fancy tools to fix your internet
Your internet might conk off mysteriously, but these are simple commands that can resolve that for you. They might not fix the problem instantly, but they will tell you where the problem lies, and if it’s on your end, fix it for you.
Related
These Windows commands are easy to learn but make a big difference
Go for the low-hanging fruit.
Apart from that, if this doesn’t resolve the issue, you can be pretty confident that the problem lies with your ISP, and it’s time to call customer support. Just make sure to run these tests to verify before shooting off an angry call.

