Created
September 10, 2025 01:22
-
-
Save Quadriphobs1/6b70b2b9395b3f1135f9a92e23bc132f to your computer and use it in GitHub Desktop.
Command to fix internet connection when Ollama reset the dns setting and can't access the internet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| networksetup -setwebproxystate Wi-Fi off | |
| networksetup -setsecurewebproxystate Wi-Fi off | |
| networksetup -setsocksfirewallproxystate Wi-Fi off | |
| networksetup -setautoproxystate Wi-Fi off | |
| unset http_proxy https_proxy | |
| sudo dscacheutil -flushcache | |
| sudo killall -HUP mDNSResponder | |
| echo "✅ Network settings reset. Relaunch apps if needed." |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What to do
fixnet.shfilechmod +x ~/fixnet.shon the filealias fixnet="$HOME/fixnet.sh"fixnetin the terminal anytime you couldn't connect after using ollama