See https://www.isc.org/docs/BIND_RPZ.pdf, page 11:
Creating a trigger rule for an IP or Subnet (v4)
Let’s say we want to rewrite any DNS queries for any hosts that resolve in the 172.16.3.0/24 subnet.
24.0.3.16.172.ns-ip IN CNAME .
As you can see, the octets in the subnet need to be reversed (similar to the way rbl in-addr.arpa works). The first number
represents the subnet mask. If we only wanted to block a single ip, the first number would be 32, which represents a /32, i.e.:
32.1.3.16.172.ns-ip IN CNAME
See also https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-dns-rpz-00#section-4.3 which shows a use of rpz-ip
instead of ns-ip
(RPZ feature was first invented by/in bind, and there are attempts to make it a full standard)
Hence, it will also depend on which bind version you are using, which you don't disclose. Look at its included documentation, and the level of RPZ support it has.