...
- Create zone 6.5.4.3.2.1.e164.arpa
- Prepare records
Following records use wildcards, which can fasten the setup but can be sometimes problematic. Be carefull especially when using more records (for dfferent numbers or prefixes)
These recorda provides translation for numbers starting with +123456 (+123456789 but also +1234567899999).No Format ; order pref flags service regexp replacement *.6.5.4.3.2.1.e164.arpa. IN NAPTR 100 10 "u" "E2U+sip" "!^(.*)$!sip:\\1@sample.edu!" . *.6.5.4.3.2.1.e164.arpa. IN NAPTR 100 10 "u" "E2U+h323" "!^\\+12(3456.*)$!h323:\\1@sample.edu!" .
First one is for SIP service. Translation of +123456789 leads to URI sip:123456789@sample.edu.
Second one is for H.323 service. Translation of +123456789 leads to URI h323:3456789@sample.edu.
You can also set up records for full numbers
Different TTL (one hour) is set in the first two records. If there is no value specified, zone settings (SOA) or default is used (it is usually one or two days).No Format $ORIGIN 6.5.4.3.2.1.e164.arpa. ; TTL order pref flags service regexp replacement 9.8.7 3600 IN NAPTR 100 10 "u" "E2U+sip" "!^(.*)$!sip:userA@sample.edu!" . 9.8.7 3600 IN NAPTR 100 10 "u" "E2U+h323" "!^(.*)$!h323:user789@sample.edu!" . 1.1.1 IN NAPTR 100 10 "u" "E2U+sip" "!^(.*)$!sip:info@sample.edu!" . 1.1.1 IN NAPTR 100 10 "u" "E2U+h323" "!^(.*)$!h323:info111@sample.edu!" .
If you are testing ENUM records consider setting up TTL to low numbers (minutes). - reload/restart the DNS server
Be careful when constructing regular expression as they can be a bit complicated. Test retrieval and functionality of your records carefully. Regexp is applied at the client side.
OS specific help
Validation, confirmation tests
Basic existence test
No Format |
---|
host -t naprt 1.1.1.6.5.4.3.2.1.e164.arpa.
or
dig -t naptr +short @nameserver 1.1.1.6.5.4.3.2.1.e164.arpa.
|
I found nice small script for those who don't like to transform the numbers to domain names manually
No Format |
---|
#!/bin/sh
host -t naptr $(echo $1 | rev | sed -e 's/[0-9]/&./g')e164.arpa
|
These commands just retrive dns record from server. To test regexp you can use php scripts at nona.net where e164.arpa, e164.org, e164.info and enum.org are queried. At CESNET site you can find script that look up e164.apra and nrenum.net.