Write BIND access control lists
Controlling access to certain features of BIND can prevent unauthorized access and attacks, such as denial of service (DoS). BIND access control list (ACL) statements are lists of IP addresses and ranges.
Before you begin
- You have configured BIND as a caching name server.
- The
namedornamed-chrootservice is running.
About this task
Each ACL has a nickname that you can use in several statements, such as allow-query that refer to the specified IP addresses and ranges.
BIND uses only the first matching entry in an ACL. For example, if you define an ACL { 192.0.2/24; !192.0.2.1; } and the host with IP address 192.0.2.1 connects, BIND grants access even if the second entry excludes this address.
BIND has the following built-in ACLs:
none: Matches no hosts.any: Matches all hosts.localhost: Matches the loopback addresses127.0.0.1and::1, and the IP addresses of all interfaces on the server that runs BIND.localnets: Matches the loopback addresses127.0.0.1and::1, and all subnets the server that runs BIND is directly connected to.
Procedure
Results
- Execute an action that triggers a feature, which uses the configured ACL. For example, the ACL allows only recursive queries from the defined IP addresses. In this case, enter the following command on a host that is not within the ACL’s definition to try to resolve an external domain:
# dig +short @192.0.2.1www.example.comIf the command returns no output, BIND is denied access, and the ACL works. For a verbose output on the client, use the command without
+shortoption:# dig @192.0.2.1www.example.com... ;; WARNING: recursion requested but not available ...