> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Flush DNS and Reset the Network Stack on Windows

> Run ipconfig /flushdns to clear the DNS cache, and netsh winsock reset or netsh int ip reset to repair the network stack on Windows Server and Windows 10/11 safely.

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.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Beginner (flush) / Intermediate (reset) | 2 to 10 minutes | Windows Server 2019 / 2022 / 2025, Windows 10 / 11 | Administrator for resets |

## Which command do I need?

| Problem | Command | Risk |
| - | - | - |
| A domain still resolves to an old IP, or a site "can't be found" after a DNS change | `ipconfig /flushdns` | None |
| Programs can't connect at all but the adapter has an address; errors after removing VPN, proxy or security software | `netsh winsock reset` | Low, needs restart |
| TCP/IP settings are corrupted | `netsh int ip reset resetlog.txt` | **Resets IP settings**, needs restart |

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

```powershell theme={null}
ipconfig /flushdns
```

```text theme={null}
Windows IP Configuration

Successfully flushed the DNS Resolver Cache.
```

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:

```powershell theme={null}
Resolve-DnsName example.com
```

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**

```powershell theme={null}
netsh winsock reset
```

**3. Restart**

```powershell theme={null}
Restart-Computer
```

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

> [!WARNING]
>
> 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](https://help.freakhosting.com/portals/vps-panel/how-to-enable-and-use-vnc-console-access.md) (or KVM/IPMI on a dedicated server), with your network details written down.

**1. Save your current settings**

```powershell theme={null}
Get-NetIPConfiguration | Out-File C:\ipconfig-before.txt
ipconfig /all >> C:\ipconfig-before.txt
```

On a VPS, the same details are on the [Network tab](https://help.freakhosting.com/portals/vps-panel/how-to-view-and-manage-network-settings.md).

**2. Reset TCP/IP**

```powershell theme={null}
netsh int ip reset C:\resetlog.txt
```

**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](https://help.freakhosting.com/portals/other/how-to-set-a-static-ip-and-dns-on-windows-server.md).

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

```powershell theme={null}
netsh winsock reset
netsh int ip reset resetlog.txt
ipconfig /release
ipconfig /renew
ipconfig /flushdns
```

> [!WARNING]
>
> 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](https://help.freakhosting.com/portals/vps-panel/how-to-enable-and-use-vnc-console-access.md) and set the address, gateway and DNS again with `New-NetIPAddress` and `Set-DnsClientServerAddress`, or with SConfig option **8**.

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every guide in this section.

> [card] [Set a static IP and DNS](https://help.freakhosting.com/portals/other/how-to-set-a-static-ip-and-dns-on-windows-server.md)
>
> Re-apply your network settings.

> [card] [Diagnose network latency](https://help.freakhosting.com/portals/other/how-to-diagnose-network-latency-issues.md)
>
> Find where lag comes from.

> [card] [Point a domain to your server](https://help.freakhosting.com/portals/other/how-to-point-a-domain-to-your-server.md)
>
> A and AAAA records.

> [card] [VNC console](https://help.freakhosting.com/portals/vps-panel/how-to-enable-and-use-vnc-console-access.md)
>
> Get in when RDP is down.

***

> [!NOTE]
>
> **Checked against Microsoft Learn and Microsoft Support: [ipconfig](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ipconfig), [netsh winsock](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/netsh-winsock), [Reset TCP/IP with netsh](https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/reset-tcp-ip-net-shell), [Clear-DnsClientCache](https://learn.microsoft.com/en-us/powershell/module/dnsclient/clear-dnsclientcache) and [Fix network connection issues in Windows](https://support.microsoft.com/help/10741)** on 4 November 2026. Commands were not tested on a live Windows server for this page.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.