Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mcs37

macrumors regular
Original poster
Mar 2, 2003
192
13
Las Vegas NV
Back on Leopard I used /etc/hosts happily like any other *nix box in the last decade, but now on Snow Leopard when I modify it to push a few changes to existing machines, the updated entries don't seem to stick. It seems when I reboot they restore to their old settings so now I have to modify /etc/hosts every time I reboot.

I'm sure I'm doing something wrong, I just have no idea what that would be -- someone please advise.
 
I'm going out on a whim here, but try giving your account full control of /etc/hosts and the system read-only privileges?
 
I haven't had any issues like that. I modified mine to point to my virtual hosts web sites. How are you editing the file? I generally just sudo the file into pico and edit it in Terminal.
 
Here we are a few weeks later and this problem is still here on Snow Leopard. Every time I reboot the damn machine I have to modify /etc/hosts again to set the local network fixed IPs. I'm a little curious why I'm the only person with this...
 
Are you sure you're writing to the file correctly? I've not used emacs, but here's my routine:

$sudo nano -w /etc/hosts
$dscacheutil -flushcache
 
Here we are a few weeks later and this problem is still here on Snow Leopard. Every time I reboot the damn machine I have to modify /etc/hosts again to set the local network fixed IPs. I'm a little curious why I'm the only person with this...

Just tested on mine... edited /etc/hosts, then rebooted. My changes persisted.
 
Mines works fine in SL and worked fine in leopard too. I copy the file to the desktop, open the file in a text editor do my changes then save it. Then i copy it into the etc folder.
 
Here we are a few weeks later and this problem is still here on Snow Leopard. Every time I reboot the damn machine I have to modify /etc/hosts again to set the local network fixed IPs. I'm a little curious why I'm the only person with this...

Just a troubleshooting idea: Make the edit as usual, and make note of the modified time for the file from Finder (or Terminal). Then go and reboot and check the modified time to see if it was modified during the reboot at some point.

As a lame temp solution, you can store a correct hosts file and have it copied into place at login by having the action stored as a launch item. I did this for a Leopard bug for a similar problem.
 
Need help with this, also

I've never worked one second in Linux, but I have to edit my hosts file in Snow Leopard to point my blog to a new IP address. I can't even FIND the hosts file in Snow Leopard. This is the total directions I was given by the techs at GoDaddy:

"Host files are text documents that you can edit with any text editor. Add the Server IP Address and your domain name to your host file on an individual line. Follow the format of any previous entries for the order of the IP address and domain name.


Host file paths for popular operating systems:



Linux: /etc/hosts

Macintosh OS X: /etc/hosts"

If you're familiar with Linux, that may be all you need. I'm not, so I'm totally lost. Can anyone help?

.greg
 
@galan05, the hosts file is in a hidden folder by default, which is likely why you are having problems finding it. Grab TextWrangler, and it will give you an option under the File menu to open hidden files, then you can go to the etc folder at the root level and find the hosts file inside it. Just be careful with the file, you can mess things ups editing it incorrectly. You'll need admin privileges to edit this file as well.
 
Experiencing the same problem. Both /etc/hosts and /private/etc/hosts gets replaced during the boot to original state.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.