how to restore hosts file from time machine

i need to restore (or reset) my hosts file but i don't know how to do it.


Can anyone please help me?

MacBook Pro (Retina, 13-inch, Late 2013), OS X Yosemite (10.10.3)

Posted on Jun 1, 2015 11:38 PM

Reply
4 replies

Jun 2, 2015 12:31 AM in response to emrewankenobi

Which hosts file? There's one in /etc and one in /private/etc

I'm assuming you're looking for the one in /etc just because I've never touched my /private/etc/hosts for whatever reason.

To get the old one, whichever it is, go into Finder, hit shift+cmd+g and type /etc (or /private/etc)

You'll be in the etc directory, which contains the hosts file, after that. Enter your Time Machine, and it'll show the old versions of that dir. You should be able to then restore the hosts file.

Jun 2, 2015 8:02 AM in response to emrewankenobi

Triple-click anywhere in the line below on this page to select it:

/etc

Right-click or control-click the line and select

Services Reveal in Finder (or just Reveal)

from the contextual menu.* A folder should open. Enter Time Machine and restore the hosts file from a snapshot that predates the unwanted changes.

*If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select

Go Go to Folder...

from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

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.

how to restore hosts file from time machine

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