Reset your network settings
Copy-paste commands to flush DNS and renew your IP on Windows, macOS and Linux, with every line explained.
Resetting network settings clears the cached DNS answers, the address your router handed out and, on Windows, the socket settings that a VPN, an outage or a router change can leave in a bad state. Run the commands for your system below, lightest first, and stop when the connection works. None of them delete your files or saved Wi-Fi passwords.
When a reset helps
- Sites won't open by name but apps that were already connected keep working: the DNS cache is stale. Flush it.
- "Connected, no internet" after the router was restarted or replaced: the device is holding an old address. Release and renew it.
- Nothing loads after installing or removing a VPN, proxy or antivirus: on Windows, reset Winsock, then TCP/IP if that wasn't enough.
When it won't help
A reset doesn't fix slow speeds, lag while the line is busy or weak Wi-Fi; those come from the line, the router's queue or the signal. Run the Lag Check to see where the problem starts, then use the guide that matches.
The order to try them in
- Flush the DNS cache. Nothing disconnects, so it is safe to try first.
- Renew the address. The connection drops for a few seconds and comes back.
- Reset Winsock and TCP/IP (Windows only). Last, because the PC needs a restart and some VPN or security software may need setting up again.
Phones and tablets
iPhone and iPad: Settings โ General โ Transfer or Reset โ Reset โ Reset Network Settings. Android: Settings โ System โ Reset options, then the Wi-Fi, mobile and Bluetooth reset (the wording varies by maker). Unlike the computer commands, these forget saved Wi-Fi networks and their passwords, Bluetooth pairings and VPN settings.
Windows
Start โ type cmd โ right-click Command Prompt โ Run as administrator.
ipconfig /flushdnsEmpties the DNS cache so stale or poisoned lookups are fetched again.
ipconfig /releaseGives your current IP address back to the router. You'll briefly go offline.
ipconfig /renewAsks the router for a fresh IP address and settings.
netsh winsock resetResets the Windows network socket catalog, which broken VPN or antivirus software can corrupt. Needs a restart.
netsh int ip resetResets TCP/IP settings to defaults. Use only if the above didn't help. Needs a restart.
macOS
Applications โ Utilities โ Terminal. You'll be asked for your password.
sudo dscacheutil -flushcacheClears the directory service cache, including DNS entries.
sudo killall -HUP mDNSResponderRestarts the macOS DNS service so it forgets cached lookups.
sudo ipconfig set en0 DHCPRenews the IP address on en0 (usually Wi-Fi on laptops). Check the interface name with `networksetup -listallhardwareports`.
Linux (systemd)
Open a terminal.
resolvectl flush-cachesClears systemd-resolved's DNS cache.
nmcli networking off && nmcli networking onRestarts all NetworkManager connections, which renews DHCP leases.
Common questions
Does flushing the DNS cache speed up my internet?
No. It makes the device look every name up again, which fixes sites that fail or open the wrong place after a change. It doesn't change your speed or your lag. For quicker lookups, see switch DNS resolver.
Will resetting network settings delete my Wi-Fi passwords?
The computer commands on this page don't. The "Reset network settings" option on a phone or tablet does: it forgets saved Wi-Fi networks, Bluetooth pairings and VPN settings, so have your Wi-Fi password ready before you use it.
What does netsh winsock reset do?
It puts the list of programs that sit between Windows and the network back to its default, removing entries left behind by VPN clients, proxies or security software. It fixes a PC that says it is connected but loads nothing after one of those was removed. Restart afterwards.
Should I restart the router as well?
Yes, if the reset didn't help or several devices have the same problem. Unplug the modem and router for half a minute, start the modem first, wait until it is online, then the router. If trouble keeps coming back, the Lag Check shows where it starts.
Made a change? Measure again to see the difference.
Run the Lag Check