After seeing a lot of articles and videos about a new .zip top level domain I want to block it to not to accidentally fall for it. For example, now all zip file names (attachment.zip for e.g.) are converted to links by web aware programs.

I searched for ways to block/redirect to localhost requests for sites on this domain, but failed. /etc/hosts doesn't support masks and other solutions seems too complicated:

  • setting up rules in iptables
  • installing and setting up dnsmasq

Is there some more or less easy solution for seemingly easy task - ban access to site/domain by mask/regexp?

I'm using Kubuntu 22.04

  • "After seeing a lot of articles and videos about a new .zip top level domain" share a few with us. And please not about targetting windows ;) "are converted to links by web aware programs." Unless I do not understand it ... this is a mime type thing. Browser on Ubuntu are sandboxed. Files outside the sandbox can not be addressed. That includes the mime type file. But like stated: I really don't get it... please share some articles. I have never heard about this and securing our personal systems is one of my job tasks ;-)
    – Rinzwind
    May 26 at 5:36
  • Oh and please do not trust articles that are from anti-virus companies. All they want is to sell you a license. 99.99999% of the things they claim are NOT affecting Linux and are only to scare Windows users that have no idea about Linux :-D
    – Rinzwind
    May 26 at 5:39

1 Answer 1


Frame challenge: that isn't realistic.

Ubuntu (and Linux in general) is not Windows. So when looking at a specific type of attack, double-check that it would be applicable to Linux and not just Windows. But... you still asked the question, and let's say you want to do it regardless.

But... you still asked the question, and let's say you want to do it regardless of that.

Also, the phrase "ban access" implies "everyone on that computer". For redirecting, you'd need a proxy (which is beyond the scope of this answer).

So let's head back to blocking. Imagine you have a page someone on your PC tries to visit, say, https://example.zip. Your computer needs to turn that domain into an IP address as part of "accessing" that website. It does this via DNS. Ok, you go and point your system DNS resolver at some other DNS resolver that doesn't resolve that TLD. It seems like you're done. You may need to flush a cache, depending on your system, but it should be blocked... or... not?

Turns out, some browsers, including Firefox have their own way of doing DNS resolving. While it can be disabled, note that users can likely go change the DNS settings in Firefox to something other than what you want (causing that TLD to function for them again).

By the way, you didn't specify browsers. From the CLI, apps can theoretically just query whatever DNS server they feel like. It is (often) bad-practice. But don't expect just changing your DNS server to stop a determined user/program from evading your TLD ban.

So, you'll need to be somewhat more clear about what you actually need

  • Why do you want to ban it? More specifically, what threat are you trying to protect against?
  • Are users on the machine willing to mess with browser DNS settings, potentially un-doing your changes? That will make blocking it way harder
  • Is there some other way to accomplish what you're going for?

This isn't to say it is flat-out impossible. But, there are a lot of complications with trying to all-out ban a TLD on your machine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.