If you are a new mac user, and you want to edit your host file to resolve hostname, you can follow this tips below.
For example : i will resolve www.its-berry.com to ip 10.0.1.1
- Open Terminal (Using Spotlight, type Terminal and press the enter key).
- In the terminal window, type:
sudo nano /private/etc/hosts - Enter your administrator password when prompted.
- The HOSTS file will appear in the Terminal window. Comments will be preceded by #. Following the comments, by default, it should start with the following:
10.0.1.1 its-berry.com
255.255.255.255 broadcasthost - Use the arrow keys on the keyboard to navigate through the HOSTS file and make any changes.
- Press Control O and then press the enter key to save changes. Press Control X to exit the HOSTS file.
- If you want the HOSTS changes to take immediate effect, type:
dscacheutil -flushcache - Type exit to logout of Terminal. To quit Terminal, right click the Terminal icon and choose Quit.
No comments:
Post a Comment