Block a Country (or ASN, or Network) Safely¶
License: pro tier and above. See Licensing. Full reference: Client Blocking.
Read this first. Nexus sees the resolver that asks, not the person behind it. Blocking a country stops resolvers located there; users in that country on a public resolver abroad are still answered, and users anywhere on a blocked country's ISP resolver are not.
Lockout warning. A block over your monitoring's addresses makes your nodes look dead to it. Add allow rules first.
New rules start in dry-run: they count matches but answer normally, so you can see the effect before it bites.
Steps¶
- Check the databases. Open Client Blocking in the WebUI (or run
gslbctl client-block list). If a banner says no country or ASN database is loaded, rules of that type will not match anything until you load one. - Add allow rules first for everything that must keep working: your monitoring, the secondaries and primaries you transfer zones with, and any partner resolvers. An allow rule always beats a block.
- Add the block in dry-run (the default):
dropsends nothing back;refuseanswers a bare REFUSED. - Watch Hits for a day. If the number is zero, the rule matches nothing (check the databases); if it is larger than you expect, find out who is asking before you block them.
- Enforce — the Enforce button, or
gslbctl client-block update <id> --enforce. Every node starts blocking within about five seconds. - To undo, press Dry run (or
--dry-run) to keep counting without blocking, or delete the rule. Deleting works even if the licence has expired.
What it does not cover¶
Only DNS. The REST API, WebUI and /metrics are HTTP; use a host firewall for
those.