0

Using C:\Windows\system32\drivers\etc\hosts or /etc/hosts file, it is possible to block individual hosts, by sending them to 127.0.0.1 or to non-existent IP address. Example:

192.68.0.254 abc.def.domain.suffix

What if I want to block all hosts under def.domain.suffix, including itself? Is it possible to use some other similar network configuration files to block them?

1
  • “What if I want to block all hosts under def.domain.suffix, including itself?” - Use a software or hardware firewall
    – Ramhound
    Nov 21, 2020 at 18:52

1 Answer 1

0

You can't do what you want within the hosts file.

The way to accomplish this is to send queries through a nameserver you control, and that provides the answers you want for the domain and its subdomains. How you do this would depend on the nameserver, but if you are at the place where you can run a combined recursive and authorative nameserver, its fairly easy and can be done multiple ways. (I know both Bind and DNSMasq can do this - the latter is commonly found on better SOHO routers and many Linux systems)

You must log in to answer this question.

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