When I try to block some websites on terminal by editing a bad address int /etc/hosts file it works in safari.

But when I try to do it with z1.fm, it doesn't. When you type the website on internet, it redirects you to z2.fm. Both z1.fm and z2.fm are the same website.

I tried to type all forms of "z1.fm" , with https/www, without, tried z2.fm.. I cleared cache, restarted my mac. Nothing worked. Example: z1.fm www.z1.fm z2.fm www.z2.fm

Is there a way i can fully block this site? I am using MacBook Air M1 MacOS Big Sur 11.6, Safari Version 15.0 (16612., 16612).

1 Answer 1


The proper way to block content in safari is with an extension that blocks content, not DNS. I use stopthemadness extension on macOS and OneBlocker on iOS / iPadOS but can’t recommend a macOS specific tool, just mention some that do different things.

If you don’t want to find an extension or can’t use that, try with safari to isolate it from search engine influence. Go to settings and turn off everything that might preload search results like suggestions, preloading and quick search.

Safari Search Preferences

Show favorites is probably safe to leave on. This is a common thing people run into when they try their hand at using the hosts file to manipulate DNS results. In your case, since z1.fm, z2.fm and www.z1.fm are not at all the same to a program. You will have to block all entry point names even though currently there may be a web redirect or both might resolve via DNS to the same IPv4 addresses in the end once a browser takes over.

bmike@m1 /Users % nslookup z1.fm

Non-authoritative answer:
Name:   z1.fm
Name:   z1.fm
Name:   z1.fm

Based on your search engine, it may also change what you type thinking you made a typo and thwart your efforts to not browse that content.

  • As I understood, no solution, except turning off everything that might preload search results, right?
    – kamran1124
    Dec 6, 2021 at 15:07
  • The apps bypass local DNS when you preload or use other servers to index sites. Literally another computer is parsing the results and feeding you data or items “from” the blocked sites. An alternate solution might be using a web content blocker that manipulates things after the browser loads from search / cache or live from a site.
    – bmike
    Dec 6, 2021 at 18:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .