Results 1 to 5 of 5

Thread: HOSTS on iMAC

  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Posts
    1,424
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HOSTS on iMAC

    Changing the HOST file on a PC has been covered but I had to hunt a bit to find the information I needed to be able to work with HOSTS on my iMAC O/S 10.4.11. John's <post:=718,421>post 718,421</post:> reminded me that I had entered this information on my iMAC way back when and I needed to remove the IP information for wopr.

    The way I accomplished the task to work with my HOSTS file follows:

    Download a free text editor - Smultron 3.5
    Download a free utility for viewing hidden files and folders - TinkerTool 3.9
    And install them of course!

    After using TinkerTool to make hidden files/folders visible, I open the Finder, click on Macintosh HD <not your Home Folder>, click on etc folder. There are items in this folder that use the same name and have extensions, but the file you need to work with is HOSTS without the file extension. Right click on the file and choose "open with" and use Smultron. Now you can add to, delete, etc. from your HOSTS file.

    Before saving your file, check your Preference for Sumatron and choose the item under "When Saving" Assign document to Smultron and use "Line endings: Leave unchanged".

    I have always made a habit of using "Save As" instead of just "Save" so I am certain where I'm saving my file to, but I see there is also a choice in Preferences to "Save As: Use folder of current document" so I do have that choice selected as well.

    When you do save, you may be asked to "authenticate" before being allowed, so use your admin name and password to do it.

    When I am done, I use TinkerTool to reset my files and folders to hidden <because I have a 3 year old who loves to play games on Grandma's computer! >.

    I hope I've covered this okay but if there are any questions, I'll be glad to try and answer them! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>


    "Peace begins with a smile. "-- Mother Teresa

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newark, New Jersey, USA
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HOSTS on iMAC

    Thanx Skitter, Here's how I do it. OS X Leopard 10.5

    First you need to enable root access:
    http://blog.stevienova.com/2008/04/10/mac-...le-root-access/

    Open a terminal window. (under utilities in applications)

    type this stuff: CASE SENSITIVE

    su - <return>
    (type in your root password)

    vi /etc/hosts<return>

    If you need to take out line, put the cursor over the line and type:

    dd <-- (delete line)

    When your done:
    ZZ <-- saves file

    If you need to add a line, put the cursor on the last letter on the last line and hit:

    i <--- insert

    use the cursor key to move one to the right and hit <return>
    Type in what ever you need. When done, hit <ESC> and then ZZ.

    Its sounds a little complicated, when or if you know vi, it's cake.

    Edit - its dd not dl (dd = delete line., dl = delete letter)
    Mike Wolfman
    Jack of all, Master of none
    Bow before me, for I am root.
    <IMG SRC=http://www.wopr.com/w3tfiles/112673-wolfsig.jpg>

  3. #3
    Bronze Lounger
    Join Date
    Feb 2001
    Posts
    1,424
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HOSTS on iMAC

    I was playing with your directions on my older iMac <O/S 10.4.11> since it also has Terminal access. I was successful in adding a line where I wanted to and then trying the "dl" command on it. It removes the line one letter at a time. And then I ended up with a blank line between the entries that I have in the host file. I tried deleting that blank line but didn't have any luck. I'm not sure what I did wrong there.

    Using "vi" would be fun but I have a feeling there are lots of commands that I'd need to learn? And then I would also have to know what to do with those commands since it seems there isn't any "undo" available! <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

    Thanks for your interesting reply!

    PS: OH - I just noticed your additional information about the "dd" versus "dl" and no wonder it only did a letter at a time! I'll try "dd" and see if it will get rid of the blank line.....hummmm....opening up the file again shows that the blank line is gone. Terminal also said I had a message.............I haven't a clue what that's all about......

    What's going on under the "hood" of this iMAC..........another world to explore.... Good thing I have a decent back up made of my important stuff! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Thanks Mike! I've lots to learn! <img src=/S/yep.gif border=0 alt=yep width=15 height=15>


    "Peace begins with a smile. "-- Mother Teresa

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newark, New Jersey, USA
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HOSTS on iMAC

    Hey Skitter, 'under the hood' of OS X is very exciting.

    FYI, if you're in vi and you want to exit without saving:

    :q!<return>

    That's a colon, lower Q, exclamation.
    Mike Wolfman
    Jack of all, Master of none
    Bow before me, for I am root.
    <IMG SRC=http://www.wopr.com/w3tfiles/112673-wolfsig.jpg>

  5. #5
    Bronze Lounger
    Join Date
    Feb 2001
    Posts
    1,424
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HOSTS on iMAC

    Hey! There's another command I can tuck into my brain bank! <img src=/S/smile.gif border=0 alt=smile width=15 height=15> Thanks!

    Have a great weekend and good luck with the switch over! I'll be ready to try typing in the new IP perhaps - when the time comes!

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>


    "Peace begins with a smile. "-- Mother Teresa

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •