Unlock File (Requried on Ventura and above) sudo chflags nouchg /private/etc/hosts Edit the file sudo nano /etc/hosts or to use VS Code: sudo code /etc/hosts