#How to open hosts file mac os x how to
Learning how to comment things is a big help when you’re working with code, and if you need to toggle back and forth between a live site, and one that’s on a remote server, you can simply comment out the line that routes that domain to the development server, in order to get back to the original site. The lines that start with # are “commented out” so that they’re not read by the system, but allow you to read any important info that the creator of the file wants you to know about. Once you enter your password, you’ll now be in the edit screen for your hosts file.
#How to open hosts file mac os x password
You can also copy and paste your password in. As you’re typing your password the cursor will not move, so hopefully you know your way around your keyboard. Next, Terminal is going to ask you for your Mac password, so go ahead and enter that next. Make sure you include the first slash before private to get you to the right directory.
This will open up your hosts file in Terminal allowing you to make edits. Once you get terminal started you will want to run the following command: sudo nano /private/etc/hosts You can find it by going in to your LaunchPad and starting to type “terminal” and hit enter to launch it, or going to your applications folder, and then to your utilities folder, and it will be in there too. In order to change your hosts file on Mac OS X, you need to use the Terminal app. You can screw stuff up in a quick hurry if you’re not careful! Start Terminal on Your Mac It’s a pretty straight forward and easy process, but a word of caution: if you’re not familiar working with the command line, proceed with caution. Some CMS and applications work best this way when you’re doing active development, and you’re not ready to adjust your domain’s zone file quite yet. This way you can maintain your DNS as it is, and work with the development site’s future domain in a real and meaningful way. It’s something that I use regularly to connect to a development server using the regular site domain but mapped to a development server’s IP address. Sometimes you need to view a site on a development server. How to edit your Mac hosts file (Mac OS X)