## BIND Configuration File Guide--Address Match Lists

### Syntax

    address_match_list    = address_match_element [ address_match_element ... ]

    address_match_element = [ "!" ] ( ip_address / ip_prefix / acl_name / "key" key_id / { address_match_list } ) ;

### Definition and Usage

Address match lists are primarily used to determine access control for various server operations. They are also used to define priorities for querying other nameservers and to set the addresses on which `named` will listen for queries. The elements which constitute an address match list can be any of the following:

- an IP address (in dotted-decimal notation),
- an IP prefix (in the '/'-notation),
- a key ID, as defined by the `key` statement, or
- the name of an address match list previously defined with the `acl` statment, or
- another address_match_list

Elements can be negated with a leading exclamation mark ("!"), and the match list names "any", "none", "localhost" and "localnets" are predefined. More information on those names can be found in the description of the `acl` statement.

The addition of the `key` clause made the name of this syntactic element something of a misnomer, since security keys can be used to validate access without regard to a host or network address. Nonetheless, the term "address match list" is still used throughout the documentation.

When a given IP address or prefix is compared to an address match list, the list is traversed in order until an element matches. The interpretation of a match depends on whether the list is being used for access control, defining `listen-on` ports, or as a topology, and whether the element was negated.

When used as an access control list, a non-negated match allows access and a negated match denies access. If there is no match, access is denied. The clauses `allow-query`, `allow-transfer`, `allow-update` and `blackhole` all use address match lists like this. Similarly, the `listen-on` option will cause the server to not accept queries on any of the machine's addresses which do not match the list.

When used with the `topology` clause, a non-negated match returns a distance based on its position on the list (the closer the match is to the start of the list, the shorter the distance is between it and the server). A negated match will be assigned the maximum distance from the server. If there is no match, the address will get a distance which is further than any non-negated list element, and closer than any negated element.

Because of the first-match aspect of the algorithm, an element that defines a subset of another element in the list should come before the broader element, regardless of whether either is negated. For example, in `1.2.3/24; ! 1.2.3.13;` the 1.2.3.13 element is completely useless, because the algorithm will match any lookup for 1.2.3.13 to the 1.2.3/24 element. Using `! 1.2.3.13; 1.2.3/24` fixes that problem by having 1.2.3.13 blocked by the negation but all other 1.2.3.* hosts fall through.

[ BIND Config. File | BIND Home | ISC ]