OS X - Operating System General OS operation information and support

OS 10.5 - Modify hosts file


Post Reply New Thread Subscribe

 
Thread Tools
penn10

 
Member Since: Jan 14, 2009
Posts: 2
penn10 is on a distinguished road

penn10 is offline
Hi, I am fairly new to Mac!

On my Windows machine, I can change the hosts file to add a URL of my own and point to localhost for my local development. Like point "mydomain" to 127.0.0.1

On Mac, I researched that I could do the same. But the problem is I can't find this /etc/hosts file. It's supposed to be under a folder called Private, but I can't find this folder at all. It must be hidden. How do I make it visible?

Thanks!
QUOTE Thanks
MacsWork

 
MacsWork's Avatar
 
Member Since: May 22, 2005
Location: Closer than you think.
Posts: 2,074
MacsWork is just really niceMacsWork is just really niceMacsWork is just really niceMacsWork is just really niceMacsWork is just really nice
Mac Specs: Performa 6116 2GBSCSI 8MB OS 7.5.3

MacsWork is offline
Open Terminal:

type

sudo cp /etc/hosts /etc/hosts.backup

then enter

You'll be asked for the logged in users password. If there isn't one just hit enter.

Next

sudo pico /etc/hosts

You will be dropped into the pico file editor.

If you want to read up on the pico editor type

man pico

in the terminal window before you begin to see what it's functions and commands are.
QUOTE Thanks
Smackintosh

 
Member Since: Jan 31, 2005
Posts: 164
Smackintosh is on a distinguished road

Smackintosh is offline
Another method is to use the "go" menu in finder. pick go and pick go to folder from the submenu. In the dialog that pops up type /private

you will now be looking a /private
QUOTE Thanks
MacsWork

 
MacsWork's Avatar
 
Member Since: May 22, 2005
Location: Closer than you think.
Posts: 2,074
MacsWork is just really niceMacsWork is just really niceMacsWork is just really niceMacsWork is just really niceMacsWork is just really nice
Mac Specs: Performa 6116 2GBSCSI 8MB OS 7.5.3

MacsWork is offline
View it all you want. Just make sure you use pico (or vi) to edit it.
QUOTE Thanks
oyi

 
Member Since: Feb 24, 2011
Posts: 1
oyi is on a distinguished road

oyi is offline
after i execute: sudo cp /ect/hosts /ect/hosts.backup

this appears:
cp: /ect/hosts: No such file or directory

please help.
my iphone is stuck in recovery and i know i need to edit my host file
but i cant seem to find it.
QUOTE Thanks
Smackintosh

 
Member Since: Jan 31, 2005
Posts: 164
Smackintosh is on a distinguished road

Smackintosh is offline
Did you jailbreak?

if so try this
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: South-East Texas
Posts: 1,803
cradom is a name known to allcradom is a name known to allcradom is a name known to allcradom is a name known to allcradom is a name known to allcradom is a name known to allcradom is a name known to all
Mac Specs: 21in Dual core 3 ghz iMac, 13in Macbook - Mountain Lion on both

cradom is offline
Quote:
Originally Posted by oyi View Post
after i execute: sudo cp /ect/hosts /ect/hosts.backup

this appears:
cp: /ect/hosts: No such file or directory
Thats etc not ect.
QUOTE Thanks

Post Reply New Thread Subscribe


« HELP!!! Lost all setting on Apple Mac. Gone back to original setting!!!!! | upgrade to 10.5x or not »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
ZFS To Become Default File System In Leopard kaidomac Apple Rumors and Reports 21 06-26-2007 02:29 PM
Huge Anti-Ad HOSTS File slows down OSX xpy OS X - Operating System 0 05-29-2007 02:10 PM
Windows 2003 File Server & Quark kegwell OS X - Operating System 0 01-15-2007 02:35 PM
Unix Executable File problem fender1100 OS X - Apps and Games 9 01-07-2007 06:20 AM
File icons not displaying properly mrgee OS X - Operating System 7 09-10-2005 06:49 AM

All times are GMT -4. The time now is 06:59 PM.

Powered by vBulletin
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?