Modify Hosts File in OS X

A.K.A, it’s difficult to change the DNS point in hosts file with OS X based system, you never can get right to save with default text editor, and VIM with sudo is terrible for tester. :(

This solution is not simple but does work.

####Sublime Text 2

Sublime is a wonderful text editor on Mac OS X, it’s not free but you can use it with license alert sometimes.

Download and Install from HERE.

####Open Hosts file

File > Open to show open file window.
The /etc folder is for system and hidden, Hit Command+Shift+G to show go to folder option and input the hosts file path manually like below:

Then it will locate to the hosts file and open it.

####Save changes to disk

Use Command + S to save (or click save on menu)

System will show a popup let you input password to authorization, only need at the first time in one session.

Hope it helps someone.