A cross-platform set of scripts to reset network configuration, refresh IP, and clear DNS cache.
Supports:
- πͺ Windows (
.ps1,.bat) - π§ Linux (
.sh) - π macOS (
.sh)
- Flush DNS cache
- Renew IP address
- Reset network stack
- Restart network services
- Optional system restart prompt
| File | OS | Description |
|---|---|---|
network-reset.ps1 |
Windows | PowerShell script |
network-reset.bat |
Windows | Batch script |
network-reset.sh |
Linux | Bash script |
network-reset-mac.sh |
macOS | Bash script |
- Right-click β Run as Administrator
- Or run manually:
Set-ExecutionPolicy Bypass -Scope Process -Force
.\network-reset.ps1- Right-click β Run as Administrator
- Or double-click (auto-elevates)
See:
chmod +x network-reset.sh
sudo ./network-reset.shSee:
chmod +x network-reset-mac.sh
sudo ./network-reset-mac.sh- You must run as Administrator / sudo
- Internet will temporarily disconnect during execution
- Restart is recommended after completion
- Error: Execution Policy Restriction
Set-ExecutionPolicy Bypass -Scope Process -Force- Error: Permission denied
chmod +x script.shCheck:
ip a # Linux
ifconfig # macOS
ipconfig # WindowsIf you see:
169.x.x.x
π DHCP failed
- Reconnect WiFi / Ethernet
- Restart router
- Run script again
ping google.comping 8.8.8.8- If 8.8.8.8 works but google.com fails β DNS issue
Set DNS manually:
- Google DNS β
8.8.8.8,8.8.4.4
Some distros donβt use NetworkManager
sudo systemctl restart networkingor
sudo service networking restartCheck active interface:
ip route # Linux
route get default # macOSUpdate script if needed:
eth0,wlan0,en0, etc.
- VPN may override DNS
- Firewall may block DHCP
π Try:
- Disconnect VPN
- Re-run script
If issues persist: π Restart system manually
-
Run only when facing:
- No internet
- DNS issues
- IP conflicts
-
Avoid frequent unnecessary resets
Designed for quick internal troubleshooting across environments with minimal setup.
This tool performs low-level network operations including resetting DNS cache, renewing IP configurations, and restarting network services.
By using this tool, you acknowledge and agree that:
- Code Created with help of multiple AI
- You are executing these scripts at your own risk.
- The author or contributors are not responsible for any system issues, network disruptions, data loss, or unintended side effects.
- This tool may temporarily disconnect your network or interfere with active connections (including VPNs).
- Behavior may vary depending on your system configuration, OS version, network policies, or administrator restrictions.
It is strongly recommended to:
- Save your work before running the tool
- Close active network-dependent applications
- Use only in troubleshooting scenarios