Can I import a "hosts" file to OSX from a Windows PC?

Hi,

I'd like to import hosts file entries from a Windows XP PC to my mac so I can do some work from home without having to use my Windows laptop. I know where to find the hosts file on the windows pc, and I can send it as a txt file to the mac.

How do I go about importing the hosts entries to the mac OS? Is the mac hosts file "cfrun.hosts.in" by any chance? I don't want to mess around until I have some clue what I'm doing (an unlikely scenario but I can still dream...).

(Please don't tell me I have to use command line on the mac to do this... ugh - though I can do it if I RLY must!)

Thanks!

Mac mini PPC (old skool!), Mac OS X (10.4.4)

Posted on Apr 8, 2008 5:43 PM

Reply
7 replies

Apr 8, 2008 6:09 PM in response to Catti

NOTE: this is a system file - make sure you understand what you are doing and make a backup copy of the original.

A Windows host file works just fine, I use the one from http://www.mvps.org/winhelp2002/hosts.htm for ad blocking. The OSX host file is located at /etc/hosts (this is a normally invisible directory) - you should use a text editor that can save as plain text with Unix EOL (vim, pico, BBEdit, TextWrangler, etc) and add your new entries after the default stuff that is in there.

Apr 8, 2008 6:28 PM in response to red_menace

{quote:title=red_menace wrote:}
NOTE: this is a system file - make sure you understand what you are doing and make a backup copy of the original.

A Windows host file works just fine, I use the one from http://www.mvps.org/winhelp2002/hosts.htm for ad blocking. The OSX host file is located at /etc/hosts (this is a normally invisible directory) - you should use a text editor that can save as plain text with Unix EOL (vim, pico, BBEdit, TextWrangler, etc) and add your new entries after the default stuff that is in there.

A Windows host file works just fine, I use the one from http://www.mvps.org/winhelp2002/hosts.htm for ad blocking. The OSX host file is located at /etc/hosts (this is a normally invisible directory) - you should use a text editor that can save as plain text with Unix EOL (vim, pico, BBEdit, TextWrangler, etc) and add your new entries after the default stuff that is in there.{quote}

Err... this seems like it might be helpful, but you're going to have to slow down. I'm old and senile and I had a rough day at work supporting Windoze.

First of all - how do I make a "normally invisible" file visible in OSX? Because I sure can't locate it in Finder right now... (first thing I tried was searching for the etc folder).

Secondly, does the mac OSX TextEdit program qualify as a text editor that can save in a "Unix EOL" (which I wouldn't know if I met it in my soup)?

Thanks again...

Apr 8, 2008 7:39 PM in response to red_menace

No luck.
Backed up existing hosts file to desktop.

Tried to save my updated hosts file in the same /private/etc/hosts folder and got error message that my user account doesn't have admin rights, when it should have admin rights afaik (checked account properties in System Preferences/accounts to be sure).

Tried downloading text wrangler, saved file in that program, can't save to the etc folder, Save As doesn't even give me the option to do so. Gripe about osx - can't manually type a file path in the Save As dialog, can't browse beyond the limited options dropdown list gives me, forced to use the useless drop-down list.

This is worse than friggin' windows... any other ideas? Sheesh.

Apr 8, 2008 8:59 PM in response to Catti

Permissions can get confusing at times. Even as an administrator, you don't have the permissions from the Finder to modify a file owned by the system (unless you change the owner), but you can still delete it since you have permissions for the enclosing folder. The Finder gives you an authentication dialog when deleting the file, but not if you try to edit it, so usually it is easier to just delete the file first (after backing it up, of course), and then copy your edited file back to the folder.

Apr 8, 2008 9:16 PM in response to red_menace

{quote:title=red_menace wrote:}
Permissions can get confusing at times. Even as an administrator, you don't have the permissions from the Finder to modify a file owned by the system (unless you change the owner), but you can still delete it since you have permissions for the enclosing folder. The Finder gives you an authentication dialog when deleting the file, but not if you try to edit it, so usually it is easier to just delete the file first (after backing it up, of course), and then copy your edited file back to the folder.

Permissions can get confusing at times. Even as an administrator, you don't have the permissions from the Finder to modify a file owned by the system (unless you change the owner), but you can still delete it since you have permissions for the enclosing folder. The Finder gives you an authentication dialog when deleting the file, but not if you try to edit it, so usually it is easier to just delete the file first (after backing it up, of course), and then copy your edited file back to the folder.{quote}

Jeez and I thought Windoze file permissions and inheritances were confusing...

The approach with Unix/mac OS is definitely different from what I'm used to. Being "used to" something isn't always a good thing. I still think in terms of being the "Godlike" admin and automatically having access to control ownership on everything. Still not clear on the concept of changing the owner of a file from "Finder" but perhaps I don't have to be?

(Glasshoppa need "unlearn". Harder than learn. Now go sleep... )

But one of these days I definitely need to find a reference book or something that would teach me the basics of unix/mac OS.

In the meantime, thanks again!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can I import a "hosts" file to OSX from a Windows PC?

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