DNS BIND acl clause

This section describes the use of the acl (Access Control List) clause available in BIND 9.x named.conf. The acl clause allows fine-grained control over what hosts or users may perform what operations on the name server.

acl clause syntax

acl acl-name { 

acl's define a address_match_list e.g. IP address(es), which can then be referenced (used) in a number of statements and the view clause(s). acl's MUST be defined before they are referenced in any statement or clause. For this reason they are usually defined first in the named.conf file. 'acl-name' is an arbitrary (but unique) quoted string defining the specific list. The 'acl-name' is the method used to subsequently reference the particular list. Any number of acl's may be defined.

The following special acl-name values are built into BIND:

  1. "none" - matches no hosts

  2. "any" - matches all hosts

  3. "localhost" - matches all the IP address(es) of the server on which BIND is running e.g. if the server has a single interface with an IP address of then localhost will match and (the loopback address is always present).

  4. "localnets" - matches all the IP address(es) and subnetmasks of the server on which BIND is running i.e. if the server has a single interface with an IP address of and a netmask of (or then localnets will match to and (the loopback is assumed to be a single address). Some systems do not provide a way to determine the prefix lengths of local IPv6 addresses. In such a case, localnets only matches the local IPv6 addresses, just like localhost.

Note: It is important to remember that only the defined IPs in the address list match will be used. Sometimes it is easier or quicker to define a negative list of IP address (all IPs EXCEPT these IP addresses) in this case the special value "any" must be used as illustrated in the fragments below:

// negative acl - this does NOT work
acl "not-these-ips" {

// negative acl - this does work
// all IPs EXCEPT 192.168.0/24 and 10.0/16
acl "not-these-ips" {

acl Examples

The following examples show acls being created and used including the 'special' acl's.

//defining acl's
// simple ip address acl
acl "someips" {;;;
 // ip address acl with '/' format
 acl "moreips" {;; // 128 IPs
// nested acl
acl "allips" {
// messy acl
acl "complex" {
  !; // negated
  {;;}; // nested
// using acl's
zone "example.com" {
  type slave;
  file "slave.example.com";
  allow-notify {"complex";}; 
zone "example.net" {
  type slave;
  masters {;};
  file "slave.example.net;
  allow-transfer {"none";}; // this is a special acl