Cannot modify '/etc/hosts' as administrator

Hi all,


I know there're a lot of discussions and solutions to this question, but my case is very strange. I have tried all the methods I've seen on the internet, including

  1. sudo nano /private/etc/hosts
  2. sudo vi /private/etc/hosts
  3. sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts (I encountered an error by running this command: TextEdit[5872:3e07] NSTrackPersistentURLs: LSSharedFileListInsertItemURL() failed at inserting URL file://localhost/private/etc/hosts (/private/etc/hosts) )
  4. Manually change permissions of private and etc foloder through Finder
  5. Use the system preference pane 'Hosts'
  6. Use Gas Mask


All methods I used above have problem overwriting the file (1, 2 said my hosts file is read only and I'm not permitted to overwrite, 5,6 didn't make a change on hosts file after I edited and saved). The account I'm using is an admin account, so I should have the permission to overwrite the hosts file. I used to be able to edit the hosts file and this problem only comes out early this year. I doubt if my hosts file is somehow damaged? Has someone here experienced it and is able to help me figure it out? I would really appreciate it.

Mac Pro, Mac OS X (10.7.5)

Posted on Nov 27, 2012 6:52 PM

Reply
18 replies

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.

Cannot modify '/etc/hosts' as administrator

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