Skip to main content
To flush DNS on Windows, run ipconfig /flushdns (or Clear-DnsClientCache in PowerShell); this is safe and needs no restart. To repair a broken network stack, run netsh winsock reset and netsh int ip reset resetlog.txt as Administrator, then restart. On a server with a static IP, the TCP/IP reset can wipe your address settings, so record them first and use the VNC console.

Which command do I need?

How to flush the DNS cache

The DNS cache stores recent name lookups so Windows doesn’t ask the DNS server every time. After you change a DNS record, Windows can keep using the old answer until the cache entry expires.
In PowerShell, Clear-DnsClientCache does the same. To see what is cached first, run ipconfig /displaydns or Get-DnsClientCache. Then check the name resolves as expected:
If it still returns the old address, the DNS server itself (or the record’s TTL) is the cause, not your cache.

How to reset Winsock

Winsock is the Windows layer programs use to open network connections. netsh winsock reset returns its catalog to a clean state and removes custom layered providers (LSPs) left behind by some VPN, proxy or security software.
1

Open an elevated prompt

Right-click Start and choose Terminal (Admin) or Command Prompt (Admin).
2

Reset Winsock

3

Restart

How to reset TCP/IP

netsh int ip reset rewrites the TCP/IP and DHCP registry settings, which Microsoft says has the same effect as removing and reinstalling TCP/IP. The log file name is required.
On a server with a static IP (common on VPS and dedicated servers), this reset can remove your IP address, gateway and DNS servers. After the restart the server may be unreachable over Remote Desktop. Do it only from the VNC console (or KVM/IPMI on a dedicated server), with your network details written down.
1

Save your current settings

On a VPS, the same details are on the Network tab.
2

Reset TCP/IP

3

Restart and re-apply the IP

Restart from the console, then set your address again if it is gone: see set a static IP and DNS.

Microsoft’s full sequence for Windows 10 and 11

For a PC with network problems, Microsoft’s troubleshooting article runs these in order in an admin Command Prompt, then restarts:
Don’t run ipconfig /release over Remote Desktop on a server. It drops the DHCP address and with it your connection. On a server with a static IP, /release and /renew do nothing useful.
On Windows 11 you can also use Settings > Network & internet > Advanced network settings > Network reset (Windows 10: Settings > Network & Internet > Status > Network reset). It removes and reinstalls all network adapters with default settings and restarts the PC, so don’t use it on a remote server.

How to check it worked

  • ipconfig /flushdns printed Successfully flushed the DNS Resolver Cache.
  • After a reset and restart, Get-NetIPConfiguration shows the right address, gateway and DNS servers.
  • Test-NetConnection 198.51.100.53 and Resolve-DnsName example.com succeed.

Frequently asked questions

Does ipconfig /flushdns need a restart?

No. The cache is cleared immediately and nothing else changes.

Does flushing DNS on my server change what visitors see?

No. It only clears the cache on that computer. Visitors use their own DNS caches and resolvers until the record’s TTL runs out.

What is the difference between netsh winsock reset and netsh int ip reset?

netsh winsock reset repairs the Winsock catalog that programs use. netsh int ip reset rewrites the TCP/IP settings themselves, including addresses. Try Winsock first; it is the less disruptive one.

My server lost its IP after a reset. How do I fix it?

Sign in with the VNC console and set the address, gateway and DNS again with New-NetIPAddress and Set-DnsClientServerAddress, or with SConfig option 8.

VPS and dedicated server guides

Every guide in this section.

Set a static IP and DNS

Re-apply your network settings.

Diagnose network latency

Find where lag comes from.

Point a domain to your server

A and AAAA records.

VNC console

Get in when RDP is down.

Checked against Microsoft Learn and Microsoft Support: ipconfig, netsh winsock, Reset TCP/IP with netsh, Clear-DnsClientCache and Fix network connection issues in Windows on 4 November 2026. Commands were not tested on a live Windows server for this page.

Need Extra Help?

If you encounter any issues, our support team is ready to assist:

Save on Your Hosting

Ready to upgrade your hosting? Use code KB20 at checkout for 20% off your first order!

Last Updated: November 2026