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)
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)
The default hosts file should have just this content:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhostWhich 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.
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.
The /etc folder is just a link to /private/etc/, so they and their contents are the same.
how to restore hosts file from time machine