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

21/01
Fri
weather - icon
Snow
2°C
22/01
Sat
weather - icon
Snow
-1°C
23/01
Sun
weather - icon
Clouds
-1°C
24/01
Mon
weather - icon
Clouds
-3°C
25/01
Tue
weather - icon
Snow
-4°C
26/01
Wed
weather - icon
Snow
-1°C
27/01
Thu
weather - icon
Snow
-1°C

Powered by OpenWeatherMap | by Phee

RSS Laracasts

  • Make it a Composable 19/01/2022
    In this episode, we'll review another technique for organizing your code: Vue composables. You can think of...
    Jeffrey Way
  • Moving Around Quicker in VS Code 19/01/2022
    Let's take a look at a handful of shortcuts and extensions you can utilize to help you...
    Jeffrey Way
  • Wrap it in a Component 18/01/2022
    The small syntax highlighting service we created in the previous episode is useful, but it still requires...
    Jeffrey Way
  • Laravel Breeze API and Next.js 17/01/2022
    Laravel Breeze now ships with an option to only scaffold the API routes needed on the backend...
    Jeffrey Way
  • Wrap it in a Module 14/01/2022
    Let's now move on to some suggestions and guidelines for how to structure and organize your code....
    Jeffrey Way