![]() Open the hosts file by typing the following into the terminal window: sudo nano /private/etc/hosts. Open Applications > Utilities > Terminal. Editing the hosts file on a Mac is done using the Terminal app. Then press Enter to add a new line for your entry. These instructions apply to Mac OS X 10.6 through 10.12. ![]() While the file is open in the nano editor, use the arrow keys to bring your cursor to where localhost ends.Let’s take a look at how you can set up the above redirection using the hosts file. You can use just about any domain and IP address you want. You can have a domain name point to something completely different than what it’s supposed to point to.įor example, if you’re trying to cut down on your social media usage, you can have domains like redirect your browser to sites like, say, Wikipedia. ![]() One of the things you can do with the hosts file is to set up redirects. ![]() You can modify these in any way you want to achieve desired results. In a nutshell, the hosts file is nothing but a combination of IP addresses and domain names. When you enter localhost in your browser, your browser looks into the hosts file, obtains the specified IP address, and takes you to that IP address. The above two parts, when combined together, redirect all the localhost queries to the IP address 127.0.0.1. The second section where it has the host name is what you use to access that IP address. The first section with numbers is the local IP address for your Mac.
0 Comments
Leave a Reply. |