Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

editing etc/hosts/ file on Snow Leopard

I have a blog on GoDaddy that is being switched from Windows hosting to Linux hosting. The Lionux version has a temporary domain name. I need to edit the hosts file to point the IP address of the Linux-hosted blog to the old domain name, then kill out the Window-hosted IP address. I'm told this is a relatively simple process once I access the hosts file.

I've never worked in Linux. I don't know where/how to find the hosts file. And the instructions I've found online that applied to Leopard don't seem to apply to Snow Leopard.

Where/how can I find this hosts file so I can point the IP address to its correct domain name?

iMac, Mac OS X (10.6.2)

Posted on Mar 19, 2010 1:43 PM

Reply
Question marked as Best reply

Posted on Mar 19, 2010 1:46 PM

First, download TextWrangler (free).

Open a Finder window. In the Go menu, select +Go to Folder+. Type in /etc and click Go. Find the file called hosts (it won't have a file extension). Open the file with TextWrangler. Do the editing. When you click Save, it will prompt you for an administrator password in order to save. Do so, and it will save.
10 replies
Question marked as Best reply

Mar 19, 2010 1:46 PM in response to galan05

First, download TextWrangler (free).

Open a Finder window. In the Go menu, select +Go to Folder+. Type in /etc and click Go. Find the file called hosts (it won't have a file extension). Open the file with TextWrangler. Do the editing. When you click Save, it will prompt you for an administrator password in order to save. Do so, and it will save.

Mar 19, 2010 3:13 PM in response to galan05

galan05 wrote:
I'm doing something wrong. When I try to save it, I get an error msg saying "the document 'hosts' could not be saved."


As Tom said, TextEdit will not suffice; TextWrangler will give you temporary access to change this file which you normally don't have permissions to modify. It was made hard-to-find for a reason.

Also, there's some coding on that file for "localhost" which is says I should not change. Am I on the wrong file?


No. You're exactly on the right file you should be on. Just don't change that first line, which says something like

+127.0.0.1 localhost+

and you'll be perfectly safe.

Message was edited by: musicwind95

Mar 20, 2010 4:31 PM in response to galan05

You can edit hosts using text edit if you set the prefs (in text edit) to save plain text file and no extension.
To actually save the file you MUST change access rights to the etc folder - CMD+i and add read and write for your account.
Later run repair permissions and it will be just fine and dandy.

editing etc/hosts/ file on Snow Leopard

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.