Updated date:

How to create ENUM Records - Creating Naptr Records

Use ENUM and avoid the PSTN costs, pic jse.net

Use ENUM and avoid the PSTN costs, pic jse.net

Creating EUM records in Bind9

This walkthrough is aimed at people who already have a DNS server running and ready to host dns records for enum. Once ENUM records can be created they can be used by Asterisk PBX by using the enumlookup function.

For a quick tutorial on how to setup a Primary DNS server in Ubuntu Try This.

When creating ENUM / NAPTR records (Naming Authority Pointer)

It is recommended that each enum number is given its own individual zone file (RFC 3761)

The enum zone records follow the format

-         Take your existing phone number e.g 98987999

-         Reverse number 99978989

-         Separate each Number ,

-         Add the domain name onto the end of the number (e.g e164.arpa)


All enum records are created using Bind9, I may go through how to create them on PDNS at a later time.

Referencing ENUM records

To keep the ENUM records and information separate from other bind9 dns information the following line was added to named.conf

include "/etc/bind/named.conf.enum";

All enum information for the your enum domain will be referenced inside named.conf.enum in the following way

zone "1.2.3.e164.arpa" {

type master;

file "/etc/bind/1.2.3.e164.arpa";


Voip Equipment

NAPTR Record Format

Creating ENUM / NAPTR Records

The enum naptr dns records were created according the RFC 2915 The Naming Authority Pointer (NAPTR) Dns Resource Records. The basic format of a NAPTR record is

IN NAPTR 100 10 "u" "sip+E2U" "!^.*$!sip:information@tele2.se!"

The naptr records consists of

Order: Order in which NAPTR records will be retrieved when there are multiple naptr records for a domain you can specify in which order they should be accessed. For example

100 10 – First Preference

100 11 – Second Preference

specifies the order in which NAPTR records with equal "order" values SHOULD be processed, low numbers being processed before high numbers.

Flags: At this time only four flags, "S", "A", "U", and "P", are defined. The "S", "A" and "U" flags denote a terminal lookup. This means that this NAPTR record is the last one and that the flag determines what the next stage should be. The "S" flag means that the next lookup should be for SRV records

Service / Protocol: Specifies protocol e.g HTTP, SIP+E2U. 'E2U+sip' to designate that a SIP address-of-record appears in the URI field of a NAPTR record. NAPTR records can be used to store a variety of different information relating to the enum number including landline numbers, mobile numbers, website addresses, emails, faxes etc.

SIP URI: The SIP URI to lookup or dial , specifies the SIP users extension or SIP alias at there designated Telecommunications Service Providers (TSP). A number of substitution characters surround the sip uri as specified by rfc2915.

Example of x.x.x.e164.arpa enum record

use this basic format when creating your NAPTR records

use this basic format when creating your NAPTR records

Testing ENUM / NAPTR records

Once individual NAPTR records have been created inside the enum zone files they can be tested through Linux using the DIG lookup tool.

Dig @example.com –t NAPTR

A successful Dig returns



;; ANSWER SECTION: 1800 IN NAPTR 5 20 "U" "E2U+web:http" "!^.*$!http://www.rmit.edu.au!" . 1800 IN NAPTR 10 10 "U" "E2U+tel" "!^.*$!tel:+432xxxxxx!" . 1800 IN NAPTR 5 10 "u" "sip+E2U" "!^.*$!sip:1000@!" . 1800 IN NAPTR 5 15 "U" "E2U+email:mailto" "!^.*$!mailto:pabx@SaIPHOST!" .

;; AUTHORITY SECTION: 1800 IN NS ns.example.com

And there you have it how to create ENUM NAPTR records, I may make a hub in the future showing how to set it up with Asterisk , doing enumlookup's etc.

Related Links


expectus (author) from Land Downunder on December 06, 2009:

thanks motricio, I think your a bit more mathematical than me I'm just doing simple electronic number mapping but I know enumeration can be used for encryption methods.

Mauricio Rodriguez from Bogota DC, Colombia on December 04, 2009:

Excellent job.

I was looking for a simple encryption method that could be applied as a new security layer on a new system.

Now I know about ENUM and its process for encoding and decoding.

We add complexity to the encryption process adding more algorithmic separations for encoding, in result you'll get a stronger encryption.

expectus (author) from Land Downunder on November 26, 2009:

thanks don :) we'll probably all be using this type of service in the future without knowing it

dusanotes from Windermere, FL on November 26, 2009:

Thanks for the Hub, Expectus. It was so far above my brain that I don't know what I learned. But I know you know what you're talking about. Thanks for giving it to us. Don White

Related Articles