Skip to content

Instantly share code, notes, and snippets.

@Quadriphobs1
Created September 10, 2025 01:22
Show Gist options
  • Select an option

  • Save Quadriphobs1/6b70b2b9395b3f1135f9a92e23bc132f to your computer and use it in GitHub Desktop.

Select an option

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
#!/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."
@Quadriphobs1
Copy link
Author

What to do

  • Copy the content above into fixnet.sh file
  • Run chmod +x ~/fixnet.sh on the file
  • Create an alias pointing to the file in your zsh or bash profile
  • alias fixnet="$HOME/fixnet.sh"
  • You can just run fixnet in the terminal anytime you couldn't connect after using ollama

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment