Example
A common use for NAPTR records is in SIP, where it is used to route phone calls over the Internet. For example, the SIP URN for the US telephone number 1-800-555-1234 would be tel:+1-800-555-1234 and its domain name 4.3.2.1.5.5.5.0.0.8.1.e164.arpa. A SIP client doing a lookup on that name might receive:
$ORIGIN 4.3.2.1.5.5.5.0.0.8.1.e164.arpa. IN NAPTR 100 10 "U" "E2U+sip" "!^.*$!sip:customer-service@example.com!" . IN NAPTR 102 10 "U" "E2U+email" "!^.*$!mailto:information@example.com!" .The first record has an order value of 100, which is lower than 102, so it is picked first. Its preference of 10 is unimportant as there are no other rules with order 100. The service name E2U+sip is an ENUM string indicating that the record can be used in phone number-to-SIP lookups. The client then goes on to apply the regexp rule !^.*$!sip:customer-service@example.com!, which replaces its entire lookup URN tel:+1-800-555-1234 with sip:customer-service@example.com. The "U" flag indicates that the replacement string is a SIP URN, and that no further rules should be applied.
To resolve SIP URN, the client then performs a second NAPTR lookup—on example.com, yielding:
$ORIGIN example.com. IN NAPTR 100 10 "S" "SIP+D2U" "!^.*$!sip:customer-service@example.com!" _sip._udp.example.com. IN NAPTR 102 10 "S" "SIP+D2T" "!^.*$!sip:customer-service@example.com!" _sip._tcp.example.com.As before, the client picks the first record because it has the lowest order value. The regexp rule replaces the lookup URN, this time with the domain name _sip._udp.example.com. The "S" flag indicates that resulting domain name points to a SRV record. The client thus finishes with _sip._udp.example.com, for which it can then fetch a SRV record to initiate a VOIP call.
Read more about this topic: NAPTR Record
Famous quotes containing the word example:
“Our intellect is not the most subtle, the most powerful, the most appropriate, instrument for revealing the truth. It is life that, little by little, example by example, permits us to see that what is most important to our heart, or to our mind, is learned not by reasoning but through other agencies. Then it is that the intellect, observing their superiority, abdicates its control to them upon reasoned grounds and agrees to become their collaborator and lackey.”
—Marcel Proust (18711922)