Troubleshooting
sudo:Common Issues
Permission denied
Error: could not save /etc/hosts. Reason: open /etc/hosts: permission deniedThe hosts file requires root/administrator privileges to modify. Use sudo:
sudo txeh add 127.0.0.1 myapp.localCommand not found after go install
txeh: command not foundThe Go binary directory may not be in your $PATH. Add it:
export PATH=$PATH:$(go env GOPATH)/binAdd this line to your shell profile (~/.bashrc, ~/.zshrc, etc.) to make it permanent.
Hosts not resolving
After adding entries, if the hostname doesn't resolve:
Flush DNS cache. You can do this automatically with
txeh --flush(or setTXEH_AUTO_FLUSH=1). See the CLI reference for details. To flush manually:macOS
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponderLinux (systemd)
sudo systemd-resolve --flush-cachesWindows
ipconfig /flushdnsVerify the entry was added:
txeh showCheck for conflicting entries. Multiple entries for the same hostname may cause unexpected behavior.
Windows hosts file location
txeh auto-detects the Windows hosts file via the SystemRoot environment variable. The default is:
C:\Windows\System32\drivers\etc\hostsIf your Windows installation uses a non-standard path, set SystemRoot or use the --read/--write flags.
Getting Help
- GitHub Issues: Bug reports and feature requests.
- GitHub Discussions: Questions and community support.
