虽然您遇到的大多数网站通常都提供丰富的信息并帮助您完成您所困的任务,但其他网站主要分散您的注意力,让您从正在做的工作中分心。这些网站通常像磁铁一样工作,它们会让你长时间坚持下去。
如果您发现自己在这些网站上徘徊了很长时间,您可能希望在您的计算机上阻止这些网站(get these sites blocked on your machine)。这样,您就间接地对自己实施限制并使这些网站无法访问。
该功能还可以帮助您阻止您不想让孩子看到的网站。这些可能是成人网站或您认为不适合您孩子的其他网站。
不管出于何种原因,在Mac上的(Mac)Safari上阻止网站是一个非常简单的过程,可以使用三种不同的方法来完成。请(Feel)随时查看我们为姊妹网站YouTube 频道(YouTube channel)制作的视频,该视频通过了这些步骤,无需您阅读!
在 Mac 上的 Safari 中使用家长控制来阻止网站(Use Parental Controls To Block Websites In Safari On Mac)
如果您查看过Mac上的“(Mac)系统(System) 偏好设置”(Preferences)面板,您可能已经看到了这个名为“家长控制(Parental Controls)”的菜单。它允许您限制某些内容在您的Mac上被查看,并且它还允许您阻止您选择的网站。
单击(Click)屏幕左上角的Apple标志,然后选择(Apple)System Preferences。
当面板打开时,找到并单击“家长控制(Parental Controls)”选项。
从左侧边栏中选择您要启用限制的用户帐户。
当右侧窗格中出现菜单时,单击显示Web的选项卡。
启用第二个选项“尝试限制对成人网站(Try to limit access to adult websites )的访问” ,然后单击旁边的“自定义”按钮。(Customize)
在以下屏幕上,单击“从不允许这些网站(Never allow these websites)”部分下方的+ (加号)按钮,将新网站添加到阻止列表中。
输入您要阻止的网站的URL ,然后(URL)按 Enter(Enter)。随意(Feel)将任意数量的网站添加到列表中。完成后单击(Click)确定(OK)。
用户将无法访问您在阻止列表中指定的网站。
该列表是可自定义的,您可以随时添加和删除网站。甚至还有一个部分可让您指定始终允许的网站。它可能包含您孩子的教育网站和类似的东西。
调整主机文件以限制对 Mac 上 Safari 中网站的访问(Tweak The Hosts File To Restrict Access To Websites In Safari On Mac)
如果您曾尝试在 Windows PC 上阻止网站(block websites on a Windows PC),那么您已经熟悉 hosts 文件。此文件可用于限制对您机器上某些网站的访问,并且它在Mac平台上也可用。
您将使用终端(Terminal)应用程序打开和编辑文件。
在Mac(Mac)上启动Terminal应用程序,在其中键入以下命令,然后按 Enter(Enter)。sudo nano /etc/hosts
由于它是 sudo 命令,因此系统会要求您输入管理员密码。输入密码并按Enter。
当文件打开时,在127.0.0.1 localhost行之后按Enter 键(Enter)。这将允许您在文件中添加一个新行。
这是您阻止网站的部分。输入127.0.0.1,按空格键(Spacebar),然后输入您要阻止的网站的网址。
例如,如果您想阻止 bing.com,您将使用以下行:
127.0.0.1 bing.com
您可以根据需要将任意数量的网站添加到阻止列表中。只需(Just)确保将每个网站放在一个新行中,并且不要更改作为Mac本地 IP 地址的前缀。
输入要阻止的所有网站的URL后,按键盘上的(URLs)Control + O键保存文件。
按Control + X键退出文件编辑模式。
一旦你回到正常的终端(Terminal)窗口,输入以下命令来刷新你的DNS缓存:
sudo dscacheutil -flushcache
它将删除DNS缓存文件,因此这些文件不会干扰主机文件的功能。
只要您指定的网站在您的主机文件中,它们就会一直被阻止。
使用应用程序在 Mac 上的 Safari 中阻止网站(Use An App To Block Websites In Safari On Mac)
上面显示的两种方式都使用Mac(Mac)上可用的内置工具来完成任务。如果您觉得它们不方便并且更喜欢更简单的选项,则可以使用第三方应用程序来阻止Mac上的网站。
输入SelfControl ,这是一款适用于(SelfControl)Mac机器的免费应用程序,可让您通过阻止计算机上的非生产性网站来重新集中注意力。使用此应用程序,您甚至可以定义您希望指定站点保持被阻止的持续时间。一旦该时间段过去,您指定的站点将再次可以访问。
下载应用程序,将其移至Applications文件夹,然后启动应用程序。
在主界面上,单击“编辑黑名单(Edit Blacklist)”按钮以指定您的网站。
单击以下屏幕上的+(加号)将网站添加到阻止列表。或者,您甚至可以导入要阻止Internet的网站。
拖动(Drag)主界面上的滑块以调整块持续时间。然后单击“开始(Start)”按钮开始锁定期。
在您在应用程序中选择的时间段内,您选择的网站将保持无法访问。
此应用程序提供的一项附加功能是一个称为白名单的列表。此列表的作用是让您指定要访问的站点,阻止 Internet 上的所有其他站点(sites on the Internet blocked)。使用此功能时要小心,仅在机器上只允许少数选定网站的特定情况下使用它。
How To Block Websites In Safari On Mac
While mоst websites yоu come acroѕs are usually informative and help you with the taskѕ you’re stυck on, other websites mainly distract you from the work you’re doing. These websites often wоrk as magnets and they keep you stuck to them for long periоds.
If you find yourself wandering around these sites for long hours, you may want to get these sites blocked on your machine. This way you’re indirectly enforcing restrictions on yourself and making these websites inaccessible.
The feature also helps you block websites that you don’t want your kids to see. These may be adult sites or other sites you don’t think are appropriate for your kids.
Regardless of the reasoning, blocking sites on Safari on a Mac is a pretty easy process and can be done using three different methods. Feel free to check out our video also that we made for our sister-site YouTube channel that goes through the steps and requires no reading on your part!
Use Parental Controls To Block Websites In Safari On Mac
If you’ve taken a look inside the System Preferences panel on your Mac, you’ve likely seen this menu called Parental Controls. It allows you to restrict certain content from being viewed on your Mac, and it lets you block your chosen websites as well.
Click on the Apple logo at the top-left corner of your screen and select System Preferences.
When the panel opens, find and click on the option that reads Parental Controls.
Select the user account you’d like to enable restrictions on from the left sidebar.
When a menu appears in the right pane, click on the tab that says Web.
Enable the second option that says Try to limit access to adult websites and then click on the Customize button next to it.
On the following screen, click on the + (plus) button beneath the Never allow these websites section to add a new website to the block list.
Type in the URL of the website you want to block and hit Enter. Feel free to add as many websites as you want to the list. Click on OK when you’re done.
The user won’t be able to access the websites you specified in the block list.
The list is customizable and you can add and remove websites at any point in time. There’s even a section that lets you specify the websites that are always allowed. It could contain your kids’ educational websites and things like that.
Tweak The Hosts File To Restrict Access To Websites In Safari On Mac
If you’ve ever tried to block websites on a Windows PC, you’re already familiar with the hosts file. This file can be used to restrict access to certain websites on your machine and it’s available on the Mac platform as well.
You’ll be using the Terminal app to open and edit the file.
Launch the Terminal app on your Mac, type the following command into it, and hit Enter.
sudo nano /etc/hosts
Since it’s a sudo command, you’ll be asked to enter your admin password. Enter the password and press Enter.
When the file opens, press Enter after the line that says 127.0.0.1 localhost. This will let you add a new line to the file.
Here comes the part where you block a site. Type in 127.0.0.1, press Spacebar, and then enter the web address of the site you want to block.
For example, if you want to block bing.com, you’ll use the following line:
127.0.0.1 bing.com
You can add as many websites to the block list as you want. Just make sure to put each website in a new line and don’t change the prefix that is the local IP address of your Mac.
Once you’ve entered the URLs for all the websites you want to block, press the Control + O keys on your keyboard to save the file.
Exit the file editing mode by pressing the Control + X keys.
Once you’re back to the normal Terminal window, type in the following command to flush your DNS cache:
sudo dscacheutil -flushcache
It’ll remove the DNS cache files so these files don’t interfere with the functions of the hosts file.
Your specified websites will remain blocked for as long as they are in your hosts file.
Use An App To Block Websites In Safari On Mac
Both of the ways shown above use the built-in tools available on your Mac to do the task. If you don’t find them convenient and you’d prefer a simpler option, you can use a third-party app to block sites on your Mac.
Enter SelfControl, a free app for Mac machines that lets you get your focus back by blocking unproductive sites on your computer. With this app, you can even define the duration for which you want your specified sites to remain blocked. Once that time period has passed, your specified sites will become accessible again.
Download the app, move it to the Applications folder, and launch the app.
On the main interface, click on the Edit Blacklist button to specify your websites.
Click on the + (plus) sign on the following screen to add websites to the block list. Optionally, you can even import the websites to be blocked from the Internet.
Drag the slider on the main interface to adjust the block duration. Then click on the Start button to start the blocking period.
Your selected sites will remain inaccessible for the time period you’ve chosen in the app.
An additional feature that this app provides is a list called a whitelist. What this list does is it lets you specify the sites that you want accessible keeping all other sites on the Internet blocked. Be cautious while using this feature and only use it in certain circumstances where only a few chosen websites are to be allowed on the machine.