简体   繁体   中英

Allow safe.duckduckgo.com but block duckduckgo.com on Mac (potentially in the hosts file)?

I want to completely disallow duckduckgo.com on my computer and only allow safe.duckduckgo.com to be reachable in any browser (on macOS High Sierra).

My initial thought was to somehow specify that in the hosts file (can be opened using sudo nano /etc/hosts ). However, if I add duckduckgo.com (using 127.0.0.1 duckduckgo.com ), then I can't reach safe.duckduckgo.com either.

A different example would be to block google.com but still allow scholar.google.com .

How can I do that?

(Or is there perhaps a better way than doing it via the hosts file?)

safe.duckduckgo.com is a CNAME for duckduckgo.com, so when you look up safe… it turns around and looks up the blocked one.

To address that, you'll need to provide hard-coded IP addresses for safe.duckduckgo.com. For example, the following should work as you expect:

127.0.0.1   duckduckgo.com
107.20.240.232  safe.duckduckgo.com

You can get the addresses this way:

$ host safe.duckduckgo.com
safe.duckduckgo.com is an alias for duckduckgo.com.
duckduckgo.com has address 107.20.240.232
duckduckgo.com has address 23.21.193.169
duckduckgo.com has address 184.72.104.138
duckduckgo.com mail is handled by 10 in1-smtp.messagingengine.com.
duckduckgo.com mail is handled by 20 in2-smtp.messagingengine.com.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM