how to edit hosts file in mac

12
07/08/15 12:45 pm How to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash Page 1 of 12 https://www.ihash.eu/2014/10/edit-hosts-file-mac-os-x-10-10-yosemite/ NEWS APPS ITUNES HOW TO STORE SPECIAL OFFERS CONTACT US

Upload: iron-force

Post on 14-Dec-2015

27 views

Category:

Documents


3 download

DESCRIPTION

How to Edit Hosts File in Mac OS X 10.9 Mavericks or later. Please note down the shortcuts before opening the vi editor and making any changes inside.

TRANSCRIPT

Page 2: How to Edit Hosts File in Mac

07/08/15 12:45 pmHow to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

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

How to Edit Hosts !le in Mac OS X 10.10YosemiteOct 19, 2014 by iHash — 5 Comments

The hosts !le is used by your computer to maphostnames to IP addresses.By adding or removing lines to your hosts 6le you can change where certain domains willBy adding or removing lines to your hosts 6le you can change where certain domains willpoint when you access them in a browser or using other software. You can block certainpoint when you access them in a browser or using other software. You can block certainhosts names, like ad-serving/malicious hosts, or used for web development purposes, i.e. tohosts names, like ad-serving/malicious hosts, or used for web development purposes, i.e. toredirect domains to local addresses.redirect domains to local addresses.

This is an important 8le and one that is under the computer administrator’s control, so you’ll need anaccount with full privileges to make any changes.

Page 3: How to Edit Hosts File in Mac

07/08/15 12:45 pmHow to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

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

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

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

Step 2: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:Step 3: Type the following command at the prompt to open hosts 8le:

WWDC 2015 IOS 9 JAILBREAK DOWNLOAD OS X 10.11 EL CAPITAN IPHONE 6

CONTACT US PUSH NOTIFICATIONS

Page 4: How to Edit Hosts File in Mac

07/08/15 12:45 pmHow to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

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

sudo nano /private/etc/hosts

Step 4:Step 4: Enter the administrator password when requested, you will not see it typed on screen as usual withthe command line

Step 5:Step 5: Once the hosts 8le is loaded within nano, use the arrow keys to navigate to the bottom of the hosts8le to make your modi8cations

Step 6: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: 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: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

Page 5: How to Edit Hosts File in Mac

07/08/15 12:45 pmHow to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

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

Share this:

Facebook 116 Twitter 116 Google Pinterest LinkedIn 28

Filed Under: How to, OS XTagged 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

How to Edit Hosts 6le in Mac OS X10.9 MavericksIn "How to"

How To Clear DNS Cache In Mac OSX10.10 YosemiteIn "How to"

How To Clear DNS Cache In Mac OSX10.9 MavericksIn "How to"

Hollywood Art InstitutePhotography Course &Certi!cation

Page 6: How to Edit Hosts File in Mac

07/08/15 12:45 pmHow to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

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

Comments

Cristian saysNov 14, 2014 at 7:00 pm

Hi. After I press Control+O I can’t 8nd the host 8le because some folder are hidden in terminal .How can I 8x this problem? Thanks in advance.

Reply

Ale saysJan 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 saysMay 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

Page 7: How to Edit Hosts File in Mac

07/08/15 12:45 pmHow to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

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

JOrgeEA saysMay 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 saysMay 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

Page 8: How to Edit Hosts File in Mac

07/08/15 12:45 pmHow to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

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

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

Page 11: How to Edit Hosts File in Mac

07/08/15 12:45 pmHow to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

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

HOW TO

How to Jailbreak Your iPhone (iOS 8.1.3– 8.3) Using TaiG Jailbreak forWindows

How to Fix a TaiG iOS 8.3 JailbreakStuck at 20%

How to Make a Bootable OS X 10.11 ElCapitan Beta USB Install Key withDiskMaker X

How to Make a Bootable OS X 10.11 ElCapitan Beta USB Install Key

How to Jailbreak Your iPhone (iOS 8.0– 8.1.2) Using PP Jailbreak for Mac

How to Enable Single ApplicationMode in Mac OS X Yosemite

How to Disable Smart Quotes andDashes in Mac OS X Yosemite

Page 12: How to Edit Hosts File in Mac

07/08/15 12:45 pmHow to Edit Hosts file in Mac OS X 10.10 Yosemite - iHash

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

RECENT COMMENTS

iHash on Where to Download (MEGA Links) the TaiGJailbreak From

TAylor on Where to Download (MEGA Links) the TaiGJailbreak From

Cantaloupe Music on New Video From Apple: Shot oniPhone 6 by Herbert S.

Megan on Major Security Flaw: Attackers Can StealPasswords From Any Installed App in iOS and OS X

jarjar on How to Clear DNS Cache with discoveryutil in MacOS X Yosemite

Copyright iHash.eu © 2015