Mac system Hosts file location and how to modify Hosts file in Mac

Source: Internet
Author: User
Tags ad server

In Windows, by modifying the Hosts file, you can block certain websites, debug the server, or crack down on some software. The Apple Mac system also owns the hosts file, but the Hosts file path is different. Many people want to modify the hosts file but are not aware of the location of the hosts file under the Mac.

First, you need to understand what is the hosts file?

The Hosts file is a computer file that is used to store information about each node in a computer network. This file is responsible for mapping the host name to the appropriate IP address. The Hosts file is typically used to supplement or replace the functionality of DNS in the network. Unlike DNS, users of the computer can control the hosts file directly.

Second, what is the role of the hosts?

1. The Hosts file can also be used for other situations, such as the ability to redirect a known ad server to an ad-free machine (usually the local IP address: 127.0.0.1) to filter ads. You can also reduce bandwidth by not downloading Web ads. Using the Hosts file can also reduce access to the DNS server to speed up access and reduce bandwidth consumption.

2. Another important use of the Hosts file is to intercept requests for malicious websites, preventing access to fraudulent websites or infecting some viruses or malware. At the same time, the file may be exploited by viruses or malware to prevent users from updating their antivirus software or visiting specific websites.

3. You can also force the site to be assigned to the correct IP by modifying the Hosts file to access sites that are inaccessible for some reason. In addition, some software cracking activation is often used in the Hosts file, the principle is that the blocking software automatically connect the official server to verify that the activation information is correct.

Third, the location of the hosts file under Mac

1. You can find the corresponding Hosts file by Shift+command+g the Quick Search box and entering /etc/hosts .

Iv. How to modify the Hosts file There are two ways to modify it.

1, find the file after clicking Open with text, will find similar copy of a hint, so that we can copy this file to the desktop, modify it, and then use the modified file to replace the original file, the process requires an account and password.

2, use the terminal to modify: sudo vi/etc/hosts to edit the document, when editing, click A to enter the editing mode, edit, save and exit. The shortcut keys are: ": wq! "This saves and exits.

This allows us to make some Web sites to block and modify.

Mac system Hosts file location and how to modify Hosts file in Mac

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.