Jump to content

HOSTS Files = ? on Mac


Skitterbug

Recommended Posts

When I want to put a dedicated IP number on my PC, I use the HOSTS file. It speeds up web pages. Where would I find this feature on an iMac? I've checked in the Utility folder on the various network apps that I have but none of them offer a way to put in IP web page info. Any help will be appreciated! TIA

Link to comment
Share on other sites

It took me a little while to figure out how to use the terminal but I finally accomplished my goal and I got the added bonus of being able to block lots of ads. <_< I recently purchased the book entitled "A Practical Guide to Unix for Mac OS X Users" by Mark Sobell and Peter Seebach. I suppose I should do more than look at the first few pages! The material that the book contains seems interesting but it also appears complicated. I have a feeling however, that if I am really going to enjoy this Mac, learning more about the Unix side of it is going to help. Thanks for the pointer to the HOSTS file information and your friendly "welcome"! I really appreciated your help!

Hi Skitterbug and welcome!I have a HOSTS file on my Mac. I use Pico in command line to put it in place.Here's where I got the info to do this:http://macmerc.com/sections.php?op=viewarticle&artid=83
Link to comment
Share on other sites

Guest LilBambi

There is another way to copy and paste the contents of a preconfigured HOSTS to the /private/etc/hosts file that may be easier in the long run - one that makes use of GUI copy and paste.Enable viewing of all files in Finder. - This can be accomplished through many different ways; manually with a command on the CLI (command line interface), or through a program, or script. (1, 2, 3), etc.)Use a text editor like Smultron* to open the hosts file (I used Mac OS X's Spotlight to locate it easily after making hidden files visible). Then highlight (Apple Cmd + A, as opposed to CNTRL + A in Windows) the contents of the current hosts file.In the same instance of Smultron, open the preconfigured HOSTS** file , highlight the contents and copy (Cmd + C) and paste (Cmd + V) over the existing/current hosts file contents. (NOTE: it opens in a side nav area - like a side tab, if you are familiar with Kate in Linux it's very similar so you can easily go between them.)* TextEdit, BBEdit, or another GUI-based text editor that you might prefer. I prefer Smultron personally...reminds me of Kate in Linux, or a couple very nice editor in Windows (EditPad and ConTEXT).** MVP HOSTS or the one from the site I posted previously, or your own homegrown one for that matter.Hope this helps. <_>

Link to comment
Share on other sites

Guest LilBambi

NOTE: I generally remove the emusic.com entry from MVP HOSTS file when I bring in a new version since I use eMusic by just deleting the line. You can do that with any entry that gets in your way.

Link to comment
Share on other sites

Confession time - I made the invisible files - visible - since I could see more in my home folder than I'd seen before! But when I searched for HOSTS, I couldn't seem to locate the file in question? I can find it using the terminal.....so now I am confused! Is there a way to delete the information from the terminal's copy that would go faster than doing it one page at a time? I am really new to this side of Mac (and to the other side too apparently! B) )Thanks for the additional information that you posted! Any ideas how I can find the HOSTS file will be appreciated!

Link to comment
Share on other sites

Guest LilBambi

You are doing great! You just were looking in the wrong place.You need to click not on your home folder, but on the Macintosh HD to find it. There will be an alias for etc in the main directory there. The HOSTS file is below the folders under etc. NOTE: There will be other HOST related things earlier in the list, but you are looking for a Hosts file with no extension.

Link to comment
Share on other sites

Yes, the HOSTS was exactly where you'd said it would be. What I don't understand is why the "search" function didn't show it? Interesting to me, I deleted the one set of blocked sites in the HOSTS file and copied/pasted the new set. When I tried to save the file, I was not allowed to do so even though I was logged in as admin. So I changed the privileges of the file but that didn't work either. So then I downloaded your suggested text editor "Smultron" and tried changing/saving the file with it. That worked and the reason it did was apparently the text editor I first used was trying to save it as a .rtf message instead of a system file. Smultron automatically saved it as UTF-8 and if I had chosen this setting in the text editor, I imagine I would have been successful with the first try! But I've accomplished what I wanted to do now and I learned lots. I appreciate you hanging in there helping me out! Thank you very much!

You are doing great! You just were looking in the wrong place.You need to click not on your home folder, but on the Macintosh HD to find it. There will be an alias for etc in the main directory there. The HOSTS file is below the folders under etc. NOTE: There will be other HOST related things earlier in the list, but you are looking for a Hosts file with no extension.
Link to comment
Share on other sites

Guest LilBambi

Excellent!!! :thumbsup: Way to go!!!Well, as you can see, I like Smultron best. It always saves in the unix style without having to worry about getting into a fight with an obtuse editor. I like that about an editor ;)Glad to have been of help!

Link to comment
Share on other sites

Guest LilBambi

BTW: Spotlight, started from the upper right corner (by clock) will generally looks in the 'user' areas of the computer.You can also open finder (which also defaults to your user area, specifically the directory and below that where you are viewing in Finder) and you will only find what's there and in subs of that location.I generally just double click the HD on the desktop OR open Finder and click on the Macintosh HD before trying to use the search.Of course, even then, it ONLY works to find the HOSTS file if the hidden files are being shown at that time.

Link to comment
Share on other sites

I must not have something set correctly. I can click on the HD and use the search option and still not bring up "hosts". If I click on the etc file folder and use search, it will show "hosts" in the results. If I try finding "hosts" by opening finder, clicking on the Mac HD, it won't show the "hosts" file. :wacko:I believe I have correctly set "all files and folders" to show because I can see .DS_Store, .hotfiles.btree, .Spotlight-V100 and so forth. I used the little application called - TinkerTool to set "Show Hidden Files and System Files". So I'm not sure why the search option still won't bring up "hosts". I could probably create an alias on the desktop so I can get to it when I want or need it and that would solve the problem for this file but I wonder why the hang up? Any ideas? TIA :whistling:

Excellent!!! :thumbsup: Way to go!!!Well, as you can see, I like Smultron best. It always saves in the unix style without having to worry about getting into a fight with an obtuse editor. I like that about an editor ;)Glad to have been of help!
Link to comment
Share on other sites

Guest LilBambi

Not sure why that is happening but you can locate it when you use TinkerTool, so I wouldn't worry about it. It's easy to find: Macintosh HD, etc alias, open hosts with Smultron. :)But maybe someone else knows why Spotlight isn't picking it up for you. It finds it here when I click on the Macintosh HD and search. ;)

Link to comment
Share on other sites

Hi LilBambi :hmm: After running the Disk Utility to correct permissions, the HOSTS file still doesn't want to be found by searching. :'(There has to be some setting someplace that's keeping this file from showing up in the search results. The categories that show in the search results are: Top Hits, Documents, Folders, Mail Messages, PDF Documents. I have everything checked in Spotlight Preference except Contacts, Events & to Do Items and Fonts. So I am perplexed..........It isn't earth 'shakingly' important but it is a small annoyance. :rolleyes: Thanks for your help - I do know where HOSTS is now! :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...