
- #Mamp pro etc hosts how to
- #Mamp pro etc hosts mac os x
- #Mamp pro etc hosts code
- #Mamp pro etc hosts password
If it doesn’t look like the sample hosts file above, you did something wrong. That command should report the file to look like this: Now to confirm the hosts file saved properly, go to the Terminal app and type the following:
#Mamp pro etc hosts password
#Mamp pro etc hosts code
Open TextEdit and paste the above code block into a new empty blank file.

TextEdit is the simple text editor bundled with every Mac, you’ll also need administrator access to complete this task since the hosts document is a system file in a restricted directory.
#Mamp pro etc hosts mac os x
Those familiar with the command line shouldn’t have a problem with this, but if you’re not quite sure what to do you can also complete the process from the TextEdit app as we’ll describe below: Restore an Unmodified Original Hosts File to Mac OS X # localhost is used to configure the loopback interface Just copy and paste this over an existing hosts file then save it as plain text to restore it. The Default & Original /etc/hosts File in Mac OS X Looks Like ThisĬontained within the code block is the original hosts file and the four default entries.
#Mamp pro etc hosts how to
If you’re not sure how to do that, you can follow these instructions to learn how to edit the file the proper way from the command line and simply overwrite it with the hosts block below, or use TextEdit and save over the messed up version, which is what we’ll walk through below. You’ll want to copy the text below and paste it into a plain text file, stored at the /etc/hosts path. No additional entries or modifications are included in the version below, which is a direct replica from that found in OS X Mavericks, making it safe to return to if you accidentally messed up the important hosts document during a change or adjustment. An example of that has been included below for convenience, but you can retrieve it from another Mac if need be as well. When you’re done with that, and you need to be able to get back to the site on the internet you simply remove that particular line of code and save the file again.Fortunately, restoring the original default /etc/hosts file back to normal is pretty easy, and the best way to get back the original untouched default file is to simply overwrite the existing damaged hosts file with a new clean version that is a copy of what comes default in Mac OS X. This will look on your system for instead of jumping out onto the internet to get it. You can type on a new line at the end of the file.įollowed by control+c then ‘y’ for yes to save the file. In my case I needed to delete a line, but you might want to add a line to have your information sent from a particular location. This brings up the text editor in the terminal and lets you edit what you need. In order to edit it in the terminal I typed the following: This is where the terminal was a great help. MAMP Pro lets me do this without having to open the terminal, but it also choked on itself tonight and refused to remove the redirect when I told it to. For instance, when I want to do work on this website, I could do it on the fly and affect everyone’s experience, or I can have redirect to a particular location on my desktop so that when I type the address into my url bar in a browser the files are being grabbed from my desktop instead of the web server on the internet. Essentially we can override our DNS information and force a particular IP address to load a certain website locally instead of having to connect to the internet. Modern browsers and internet connection use DNS to take care of this problem, but HOST files still have great value locally. This happened to me today so I thought it would be beneficial to talk about the HOST file on our machines.Įssentially the file links the IP address of the internet server to the actual hostname (URL) we’re looking for. On occasion, we use applications like MAMP Pro to help us do these sorts of things, but frequently we have a hiccup or two along the way.


Sometimes we web developers like to edit our websites locally, and then test them on our local machines before we push them out to the internet.
