Search Computer Help Please

Monday, November 23, 2009

Setup ENUM Server with Linux and Bind9

This post will go through the steps for setting up a simple ENUM (Electronic Number Mapping) server on ubuntu linux operating system.

The basic idea behind ENUM is to map your regular E.164 telephone numbers to domain zone files for example your number 98997867 may become Each enum number is given its own zone file which contains a variety of contact methods available for that number. These records are referred to as NAPTR records.

Financial Savings of ENUM

The main reason ENUM exists is to try and connect the IP networks with the telephone networks, with the main objective of avoiding the PSTN (public switch telephone network) and the high costs associated with using these services and termination fee's.

Bind9 DNS Records in Ubuntu

This quick tutorial will go through setting up a simple bind9 enum server capable of hosting an number of records for enum numbers. If your planning on setting up a proper enum server I will cover this topic later on, and how you can hook it up to your Asterisk PBX.

Install Bind9

First ensure you are in root mode using "sudo su"
apt-get -y install bind9

Once bind9 is installed all files and information for bind9 will be found in the directory /etc/bind

once you are in the directory "cd /etc/bind"

you are ready to modify and create the zone files for your enum domain in this example the domain being


1.) modify named.conf

Modify the file named.conf , using your preferred editor (e.g nano named.conf, or vim named.conf)

Add the following line to the file

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

This just specifies that the file named.conf.enum will be used to store DNS information used by bind9

2.) Create named.conf.enum (simply edit the file and a new file will be created)

Add the following line to the file, ensuring that the format stays intact

add following line

zone "" {
type master;
file "/etc/bind/";


Here we specify the name of the zone , the type of server (e.g master, slave) and the file that contains the information for the zone.

3.) Create file

add the following to

TTL 86400 IN SOA (
2004011522 ; Serial no., based on date
21600 ; Refresh after 6 hours
3600 ; Retry after 1 hour
604800 ; Expire after 7 days
3600 ; Minimum TTL of 1 hour
) 43200 IN NS
; 43200 IN A NAPTR 10 100 "u" "E2U+sip" "!^.*$!!". NAPTR 10 101 "u" "E2U+h323" "!^.*$!!". NAPTR 10 102 "u" "E2U+msg" "!^.*$!!". NAPTR 100 10 "U" "SIP+E2U" "!^.*$!!".

The file contains information for the zone on the private enum server.

at the very bottom of the zone file contains the enum zone files and naptr contact methods associated with the zones.

The first one is E2U or e164 to URI type of NAPTR record which returns a sip uri of, this is the URI that will later be used by your Asterisk PBX.


Remember whenever changes are made to zone files the naming service needs to restarted to apply the changes using

/etc/init.d/bind9 restart

To test an ENUM record use the DIG tool

dig @ -t NAPTR

this will return an answer section containing the sip URI

Note: Any problems you may have such as bind9 not restarting correctly or returning a fail are usually due to incorrect format being used or missing zone files.

always check your /var/log/syslog for errors when troubleshooting

Hope people find this useful, in my next posts I will talk about hosting a private domain name to serve enum records within a private network (I-ENUM private) , as well as testing enumlookup using Asterisk 1.4, 1.6.

I may also cover how to setup a more efficient DNS server using powerdns or similar tools which use databases instead of individual files to store zone records.


  1. good mini howto hope asterisk+enum :)

  2. thanks a lot for the info given

  3. Is it possible, not to get additional information in the NAPTR DNS response packet?

    Additional information contains the SVR records.

    Is there any configuration required in config file.

    Please help. Thanks in advance.

  4. you write 43200 IN A

    what IP is this? Is this IP address of the destination (output) of enum server?

  5. was the ip address of the enum server in this example

  6. and what is the 43200 please

  7.!". Where does this number come from ?


Computer Help Please