How to modify the Hosts file under Mac OS X system

Source: Internet
Author: User

The OSTs file, equivalent to a URL-ip list, is roughly equivalent to native DNS. Modify the Hosts file on your Apple computer to access some of the Web sites that are in harmony, or to intercept certain sites (such as software vendors ' genuine authentication), or to force downloads of files from an IP, and so on. Here's how to modify the Hosts file under Mac OS X system, which is very simple and does not have to install third-party software.

 Method One:

  (Note that the method is the most basic, but relatively cumbersome.) Do not want to understand the principle of the user can jump directly below to see more convenient direct Method II)

The Hosts file is located under the/private/etc/hosts path of the Apple computer, but you can't see it directly in the Finder ... That's a hidden folder. You can click the Finder, select "Go"-"Go to Folder" in the top menu bar, and stick to the "/private/etc/" path (without quotation marks)

Then you can see the files in the folder, find the "hosts" file, copy one to the desktop. You can edit the Hosts file with a text editor that comes with your Mac OS X system. Add the hosts information you want to access (or intercept) and then save it and drag it back to the/private/etc/folder in the Finder. When you drag it back, the Mac pops up and the alarm says it can't move the item. Click on the "Authentication" button and enter your computer password.

  Method Two:

Open the terminal (can't find, click the magnifying glass button in the upper right corner of the Mac screen, Spotlight search Terminal two words), paste into the following command line, you can directly open the Hosts file with a text editor, modified directly saved.

Sudo/applications/textedit.app/contents/macos/textedit/etc/hosts

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.