Edit hosts file on OSX

  05/06/2017

I had to modify local hosts file on OSX many times and it’s not just about edit and save because it requires few more things before and after.

To properly edit the hosts file on OSX, first you need to get super user access, then to remove protection from hosts file with chflags, edit hosts file and save, flush DNS cache (optional), and to set back the hosts file as protected (otherwise it will not work).

sudo su –
chflags nouchg /private/etc/hosts
sudo nano /private/etc/hosts
sudo killall -HUP mDNSResponder
chflags uchg /private/etc/hosts


Weather Forecast – Belgrade

18/11
Sun
weather - icon
Clear
6°C
19/11
Mon
weather - icon
Snow
2°C
20/11
Tue
weather - icon
Rain
4°C
21/11
Wed
weather - icon
Rain
4°C
22/11
Thu
weather - icon
Rain
5°C
23/11
Fri
weather - icon
Rain
4°C
24/11
Sat
weather - icon
Rain
4°C

Powered by OpenWeatherMap | by Phee

Contact