NAPTR record

With NAPTR ( Naming Authority Pointer ) resource records DNS names are assigned addresses of servers and other information.

Background

Traditionally, be resolved via the DNS service names into IP addresses. It sends a name to a DNS server and receives an IP address back ( behind which is then usually a server hides ). This simple and proven method today is in many cases insufficient, as the inquirer often need further information.

NAPTR records provide this additional information in a very flexible manner. Among other things, the protocol is specified, the server uses. Via the weighting, if multiple NAPTR records exist for a name, a prioritization be set. Additionally, if multiple NAPTR records have the same priority to a name exist, be achieved by preferential load balancing.

The NAPTR record type can thus be seen as an extension of the classic A records ( SRV records or also ).

Construction

The structure of NAPTR records is complicated because a number of cases has to be covered. A major difficulty is that often not directly a server name is returned, but a regular expression, which must first be resolved.

Simple example of a NAPTR records (without regular expression ):

Dienst.example.com. IN NAPTR 100 10 "A" "" "" prodserver.example.com. Links is here a DNS name and the far right, a reference to the name of a server that provides the desired service. The "A" means that the rightmost term " prodserver.example.com " is an A record. To obtain the IP address, so that a further step is still required: This A record must be resolved ( some name server like BIND do it but independently and provide the IP address in the Additional section - with ).

Currently, the following flags are defined:

  • A - the result is an A record
  • S - the result is an SRV Record
  • U - the result is a URI
  • Empty - the result is a NAPTR record.

To obtain the IP address of the server you want, so you have at least put one more DNS request or a URL be resolved in each case. With an empty flag another NAPTR request is required. One speaks in this case of a concatenation.

Example regular expression

The above example is achieved by inclusion of a regular expression:

Dienst.example.com. IN NAPTR 100 10 "A" "" "! ^. * $! Prodserver.example.com! ". The regular expression matches a POSIX Extended Regular Expression. The first character occurring in the regular expression ( here "!") Serves as the delimiter. It is useful as a delimiter, for example, the "!" "/" to select instead of the commonly used limiter, since URLs often already contain "/", making it easier to read the regular expression. In the first defined by the field delimiters (^. * $ ) Are information that defines which parts of the input string ( dienst.example.com. ) By the right-wing from the limiter String ( prodserver.example.com ) should be replaced. . " ^ * $ " Means: It is to be replaced everything.

592222
de