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

26/05
Thu
weather - icon
Rain
24°C
27/05
Fri
weather - icon
Clouds
26°C
28/05
Sat
weather - icon
Rain
15°C
29/05
Sun
weather - icon
Rain
18°C
30/05
Mon
weather - icon
Rain
18°C
31/05
Tue
weather - icon
Rain
24°C
01/06
Wed
weather - icon
Clear
27°C

Powered by OpenWeatherMap | by Phee

RSS Laracasts

  • Horizontal and Vertical Spacing 26/05/2022
    Grid is two-dimensional. The size of content in one cell affects the size of all other cells...
    Jeffrey Way
  • Little Confusing Things 25/05/2022
    At this stage, I fully expect you to be confused in numerous ways. We went from building...
    Jeffrey Way
  • Modern Dates with the Temporal API 24/05/2022
    The Temporal API in JavaScript is set to replace the outdated Date object, which has been around...
    Jeffrey Way
  • Spacing Between Cells 23/05/2022
    Rows and columns can be spaced in a variety of ways in a CSS grid. Let's look...
    Jeffrey Way
  • Vite 20/05/2022
    Great job, if you've made it this far. I think you're now ready to move on to...
    Jeffrey Way