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

07/08
Sun
weather - icon
Clear
31°C
08/08
Mon
weather - icon
Rain
35°C
09/08
Tue
weather - icon
Rain
26°C
10/08
Wed
weather - icon
Rain
25°C
11/08
Thu
weather - icon
Clear
26°C
12/08
Fri
weather - icon
Rain
28°C
13/08
Sat
weather - icon
Clouds
22°C

Powered by OpenWeatherMap | by Phee

RSS Laracasts

Latest Tweets