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

15/06
Tue
weather - icon
Rain
21°C
16/06
Wed
weather - icon
Clouds
25°C
17/06
Thu
weather - icon
Clouds
25°C
18/06
Fri
weather - icon
Rain
26°C
19/06
Sat
weather - icon
Rain
27°C
20/06
Sun
weather - icon
Clear
29°C
21/06
Mon
weather - icon
Clear
29°C

Powered by OpenWeatherMap | by Phee

RSS Laracasts

  • Add Comments 14/06/2021
    Continuing on, we work on allowing the user to add comments to the idea.
    Jeffrey Way
  • Comment Model and Migration 14/06/2021
    We get started on the comments feature that allows users to discuss an idea. We create our...
    Jeffrey Way
  • Success Message Notification 09/06/2021
    Let's now wire up our notification with the actions in our application.
    Jeffrey Way
  • Build the Log In Page 09/06/2021
    We wrapped up the previous episode by creating a Log In link, but we stopped just short...
    Jeffrey Way
  • Login and Logout 08/06/2021
    The final piece of the puzzle is the actually log the user in. We can once again...
    Jeffrey Way