OtherMedium

Network Stack Reset: Step-by-Step Guide for All OSes

The network stack handles connections and can fail due to outdated drivers or software conflicts. This guide shows how to safely clear the cache and reset network settings on Windows, macOS, and Linux to restore a stable connection.

Updated at April 6, 2026
10-15 min
Easy
FixPedia Team
Применимо к:Windows 10/11macOS Ventura+Ubuntu 22.04+, Debian 12+

Introduction: Why a Full Network Reset Is Needed

The network stack is a set of protocols (primarily TCP/IP, Winsock, DNS) that manages data transfer between your device and the internet. Over time, errors accumulate within it: outdated routes, corrupted resolver entries, conflicts after driver updates, or sudden power loss. A full reset returns settings to factory defaults, clearing temporary tables without touching personal files. After completing this guide, you will have a clean network environment that will eliminate lag, packet loss, and connection errors.

Preparation: What to Check Before Starting

Ensure you have access to an account with administrator privileges or the ability to use sudo. If you are connected via Wi-Fi, write down your access point password in advance: after the procedure, the system may require re-authentication.

⚠️ Important: On laptops, connect the charger. Interrupting the process due to a dead battery can damage the network adapter's configuration.

Step 1: Launching the Terminal with Elevated Privileges

The OS interface does not provide direct access to low-level routing tables, so work must be done via the console.

  • Windows: Press Win + S, type PowerShell, right-click, and select "Run as administrator". Confirm the UAC prompt.
  • macOS: Open "Terminal" via Spotlight (Cmd + Space). The system will request your password when entering commands with sudo.
  • Linux: Use Ctrl + Alt + T. All commands are executed with sudo.

Step 2: Clearing Cache and Resetting Protocols

Commands vary depending on your operating system. Enter them one by one, waiting for each to complete successfully.

Windows

ipconfig /flushdns
netsh int ip reset
netsh winsock reset

The first command clears the DNS cache, the second resets the TCP/IP configuration, and the third reinstalls the Winsock catalog (which handles application-network interaction).

macOS

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

This command force-clears the system DNS cache and restarts the mDNSResponder resolver service.

Linux (systemd)

sudo systemctl restart systemd-resolved
resolvectl flush-caches

Restarting the systemd-resolved service and flushing the local cache resolve most routing conflicts in modern distributions.

Step 3: Reboot and Adapter Initialization

After running the commands, restart your computer. On Windows and macOS, the system will automatically recreate routing tables and request a new IP address from the router via DHCP. On Linux, ensure the network management service is active after startup:

systemctl status NetworkManager

If the status is active (running), the adapters are ready for use.

Verifying the Result

Open your browser and load several independent websites (e.g., google.com and github.com). For detailed diagnostics, use ping:

ping 8.8.8.8

If packets are not lost (0% loss) and the time values are consistently within 5–50 ms (for wired connections), the stack is restored. Additionally, check DNS functionality:

nslookup google.com

The utility should return a correct IP address without timeouts.

Potential Issues

  • "Access Denied" error: Ensure the terminal is actually running with administrator privileges (sudo or "Run as administrator"). Normal execution mode blocks writing to system tables.
  • Wi-Fi loss after reboot: Go to network settings, select the saved network, and re-enter the password. Sometimes temporarily disabling the adapter via the system tray and then re-enabling it helps.
  • Reset didn't help: Try updating your network adapter driver from your motherboard or laptop manufacturer's website. If the problem persists, temporarily disable third-party antivirus software and firewalls, which may be blocking traffic at the packet filtering level.

F.A.Q.

Is it necessary to restart the computer after resetting?
Will I lose saved Wi-Fi passwords?
What to do if the internet still doesn't work after the reset?

Hints

Open terminal with administrator privileges
Execute TCP/IP and DNS reset commands
Restart the system

Did this article help you solve the problem?

FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community