hosts file in MAC X
Let us know where is the hosts file in MAC X and how to edit it.
The hosts file in MAC is located in /private/etc/hosts
1. Open the terminal
2. If you can use the vim, do give the command as vim /private/etc/hosts
3. you can see the below
It has one entry per line, with the hostname followed by the IP address.
4. Add your entries to the end of the file.
5. Save the file by pressing Control + O keys and press Enter.
6. To get the changes reflected, the DNS cache needs to be flushed.
OS X 10.5 or later use this command:
OS X 10.4 or earlier use: kindly use
Now you have edited the hosts file and the changes will reflect in the browser by refreshing it.