mac 系統偏好設置很卡_如何從系統偏好設置編輯Mac的主機文件

mac 系統偏好設置很卡

mac 系統偏好設置很卡

It’s a time-honored hack: editing the hosts file on your computer to block websites, create local re-directs, and otherwise change what happens when you type particular domains into you address bar.

這是歷史悠久的黑客:在計算機上編輯主機文件以阻止網站,創建本地重定向,以及更改在地址欄中鍵入特定域時發生的情況。

We’ve shown you how to edit your hosts file using the Terminal on your Mac. While that method’s not hard, it’s a little out of the way if you just want to occasionally block Reddit and Facebook, or experiment with re-directing a few domains to your own local servers.

我們已經向您展示瞭如何使用Mac上的終端編輯主機文件。 雖然這種方法並不難,但是如果您只是想偶爾阻止Reddit和Facebook,或者嘗試將一些域重定向到您自己的本地服務器,則有點麻煩。

Happily, there’s Hosts Preference Pane, a tiny application that lets you edit the Hosts file from the macOS System Preferences. To get started, head to the Hosts.prefpane download page and grab the latest version. The download comes in the form of a PKG installer.

令人高興的是,有一個Hosts Preference Pane ,一個微型應用程序,可讓您從macOS系統偏好設置中編輯Hosts文件。 首先,請前往Hosts.prefpane下載頁面並獲取最新版本。 下載以PKG安裝程序的形式出現。

Open the installer and go through the steps.

打開安裝程序,並按照步驟操作。

When that’s done, open System Preferences and you’ll see a new 「Hosts」 icon in the bottom row.

完成後,打開系統偏好設置,您將在底行看到一個新的「主機」圖標。

Click this and you’ll be brought to your brand new Hosts preference pane.

單擊此按鈕,您將進入全新的「主機」首選項窗格。

Editing the hosts file requires administrator permissions, so to get started you’ll need to click the lock at bottom-left. You’ll be asked for your fingerprint, if you have Touch ID. Otherwise you’ll be asked for your password.

編輯主機文件需要管理員權限,因此,開始之前,您需要單擊左下角的鎖。 如果您具有Touch ID,則會要求您提供指紋。 否則,將要求您輸入密碼。

Note that only administrator accounts can change the hosts file: if you’re not an administrator, this isn’t going to work.

請注意,只有管理員帳戶才能更改主機文件:如果您不是管理員,則此操作將無效。

Once everything is unlocked, you can add and remove domains to your liking by using the 「+」 and 「-」 buttons at bottom left. If you’ve edited a hosts file before, you know the drill: use 「127.0.0.1」 as the IP, then add the domains you’d like to block.

解鎖所有內容後,您可以使用左下方的「 +」和「-」按鈕根據自己的喜好添加和刪除域。 如果您以前曾編輯過hosts文件,那麼您就會知道演練:使用「 127.0.0.1」作爲IP,然後添加要阻止的域。

The 「use」 column, meanwhile, allows you to quickly remove a line from the hosts file without losing track of it. Anything unchecked in the Hosts Preference Pane won’t show up in the actual hosts file, allowing you to quickly remove and re-add domains you need to occasionally use.

同時,「使用」列可讓您從主機文件中快速刪除一行,而不會丟失它。 主機首選項窗格中未選中的所有內容都不會顯示在實際的主機文件中,從而使您可以快速刪除並重新添加偶爾需要使用的域。

Any change you make here is instantly made to the hosts file—you can confirm this by heading to /private/etc/ on your computer and opening the hosts file. For our purposes, however, the best check is to open your browser and head to a domain you’ve re-directed.

您在此處所做的任何更改都會立即對hosts文件進行-您可以通過轉到計算機上的/ private / etc /並打開hosts文件來確認。 但是,出於我們的目的,最好的選擇是打開瀏覽器並轉到您已重定向的域。

If everything is working you should see the change immediately, though sometimes restarting the browser is necessary. Enjoy your new hosts file!

如果一切正常,則應該立即看到更改,儘管有時必須重新啓動瀏覽器。 享受您的新主機文件!

翻譯自: https://www.howtogeek.com/313026/how-to-edit-your-macs-hosts-file-from-system-preferences/

mac 系統偏好設置很卡