open hosts file in mac os code example Example: mac host file sudo nano /etc/hosts sudo killall -HUP mDNSResponder