Você está na página 1de 12

How to Edit Hosts file in Mac OS X 10.

10 Yosemite - iHash

NEWS

APPS

ITUNES

HOW TO

07/08/15 12:45 pm

STORE

https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/

SPECIAL OFFERS

CONTACT US

Page 1 of 12

How to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

07/08/15 12:45 pm

How to Edit Hosts !le in Mac OS X 10.10


Yosemite
Oct 19, 2014 by iHash 5 Comments

The hosts !le is used by your computer to map


hostnames to IP addresses.
By adding or removing lines to your hosts 6le you can change where certain domains will
point when you access them in a browser or using other software. You can block certain
hosts names, like ad-serving/malicious hosts, or used for web development purposes, i.e. to
redirect domains to local addresses.

This is an important 8le and one that is under the computer administrators control, so youll need an
account with full privileges to make any changes.

https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/

Page 2 of 12

How to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

WWDC 2015

CONTACT US

IOS 9

JAILBREAK

07/08/15 12:45 pm

DOWNLOAD

OS X 10.11 EL CAPITAN

IPHONE 6

PUSH NOTIFICATIONS

Making a backup of the hosts 6le can be a good idea if you plan on making signi6cant
changes or just want to play around with modi6cations and see what happens.

Step 1: Launch Terminal, found in /Applications/Utilities/ or launched through Spotlight


Step 2: Type the following command at the prompt to backup hosts 8le to documents folder:

sudo cp /private/etc/hosts ~/Documents/hosts-backup

Step 3: Type the following command at the prompt to open hosts 8le:

https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/

Page 3 of 12

How to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

07/08/15 12:45 pm

sudo nano /private/etc/hosts

Step 4: Enter the administrator password when requested, you will not see it typed on screen as usual with
the command line
Step 5: Once the hosts 8le is loaded within nano, use the arrow keys to navigate to the bottom of the hosts
8le to make your modi8cations
Step 6: When 8nished, hit Control+O followed by ENTER/RETURN to save changes to /private/etc/hosts,
then hit Control+X to exit out of nano
Step 7: Verify your hosts modi8cations. You may need to clear DNS cache 8rst.

If you want to restore the modi6ed hosts to the backup of the original 6le use this command:

sudo cp ~/Documents/hosts-backup /private/etc/hosts

https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/

Page 4 of 12

How to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

07/08/15 12:45 pm

Share this:

Facebook

116

Twitter

116

How to Edit Hosts 6le in Mac OS X


10.9 Mavericks
In "How to"

Google

Pinterest

LinkedIn

28

How To Clear DNS Cache In Mac OSX


10.10 Yosemite
In "How to"

How To Clear DNS Cache In Mac OSX


10.9 Mavericks
In "How to"

Filed Under: How to, OS X


Tagged With: block hosts, edit hosts 6le, Edit Hosts Yosemite, hosts, hosts 6le location yosemite, OS X 10.10 Yosemite,
OS X Yosemite, terminal

SPECIAL OFFERS

Hollywood Art Institute


Photography Course &
Certi!cation

https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/

Page 5 of 12

How to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

07/08/15 12:45 pm

Comments

Cristian says
Nov 14, 2014 at 7:00 pm
Hi. After I press Control+O I cant 8nd the host 8le because some folder are hidden in terminal .
How can I 8x this problem? Thanks in advance.
Reply

Ale says
Jan 9, 2015 at 8:26 pm
it worked for me. I just could not save the 8le in Textedit because some denied permission issue.
But this did it. thnx
Reply

JOrgeEA says
May 27, 2015 at 3:50 am
Hi. After I press Control+O appear this:
File Name to Write: /private/etc/hosts
^G Get Help ^T To Files M-M Mac Format M-P Prepend
^C Cancel M-D DOS Format M-A Append M-B Backup File
What can i do?
Reply

https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/

Page 6 of 12

How to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

07/08/15 12:45 pm

JOrgeEA says
May 27, 2015 at 3:52 am
Hello. After I press Control+O show that:
File Name to Write: /private/etc/hosts
^G Get Help ^T To Files M-M Mac Format M-P Prepend
^C Cancel M-D DOS Format M-A Append M-B Backup File
what can I do?
THNks
Reply

iHash says
May 27, 2015 at 7:37 am
After Control+O press ENTER, then press Control+X
Reply

Leave a Reply
Your email address will not be published. Required 8elds are marked *
Name *

Email *

Website
https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/

Page 7 of 12

How to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

07/08/15 12:45 pm

Comment

POST COMMENT

Con8rm you are NOT a spammer


Notify me of follow-up comments by email.
Notify me of new posts by email.

SEARCH

Search the site ...

Drive Genius 4

https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/

Page 8 of 12

How to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

07/08/15 12:45 pm

Welix Two-Wheel
Electric Scooter

TigerVPN Lite: Lifetime


Subscription

Hollywood Art Institute


Photography Course &
Certi!cation

Urge Basics Cuatro


Bluetooth Speaker for
$34

https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/

Page 9 of 12

How to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

07/08/15 12:45 pm

SUBSCRIBE

Subscribe To Receive Latest Updates


Get latest news, rumors, tips&tricks, price
drops on apps, how to's and more!
Enter your name here...
Enter your email address here...
SIGN UP

https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/

Page 10 of 12

How to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

07/08/15 12:45 pm

HOW TO

How to Jailbreak Your iPhone (iOS 8.1.3


8.3) Using TaiG Jailbreak for
Windows
How to Fix a TaiG iOS 8.3 Jailbreak
Stuck at 20%
How to Make a Bootable OS X 10.11 El
Capitan Beta USB Install Key with
DiskMaker X
How to Make a Bootable OS X 10.11 El
Capitan Beta USB Install Key
How to Jailbreak Your iPhone (iOS 8.0
8.1.2) Using PP Jailbreak for Mac
How to Enable Single Application
Mode in Mac OS X Yosemite
How to Disable Smart Quotes and
Dashes in Mac OS X Yosemite
https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/

Page 11 of 12

How to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

07/08/15 12:45 pm

RECENT COMMENTS
iHash on Where to Download (MEGA Links) the TaiG
Jailbreak From
TAylor on Where to Download (MEGA Links) the TaiG
Jailbreak From
Cantaloupe Music on New Video From Apple: Shot on
iPhone 6 by Herbert S.
Megan on Major Security Flaw: Attackers Can Steal
Passwords From Any Installed App in iOS and OS X
jarjar on How to Clear DNS Cache with discoveryutil in Mac
OS X Yosemite

Copyright iHash.eu 2015

https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/

Page 12 of 12

Você também pode gostar