29.06.2015 Views

Expert Documentation

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6 <br />

6.4.1.7.4 DNS (Domain Name System)<br />

The DNS is a directory system distributed on Internet.<br />

The basic function of a DNS server is to convert domain names into IP addresses. This is<br />

done:<br />

- Through a DNS A request to convert a name into an ipv4 IP address<br />

- Through a DNS AAAA request to convert an name into an ipv6 IP address.<br />

Any SIP entity can use the DNS if the domain part of a URL appears as a name, in order to<br />

convert it into an IP address.<br />

For SIP, the DNS can also be used to resolve protocol type, address and the port number<br />

where requests relating to a given SIP address must be sent. This is done through NAPTR<br />

and DNS SRV requests.<br />

6.4.1.7.5 NAPTR and DNS SRV<br />

An answer to a NAPTR (Naming Authority Pointer) request for a given domain name consists<br />

of one or several NAPTR records. A NAPTR record contains the supported transport protocol<br />

(UDP, TCP, TLS over TCP, ...) and the replacement name to be used for DNS SRV requests.<br />

The example below shows NAPTR records which could be obtained for a NAPTR request for<br />

the domain "mydomain.com".<br />

Example:<br />

Order pref flags service regexp replacement<br />

IN NAPTR 50 50 “s” “SIP+D2T” “” _sip._tcp.mydomain.com<br />

IN NAPTR 90 50 “s” “SIP+D2U” “” _sip._udp.mydomain.com<br />

The records indicate that the server supports TCP and UDP in that order of preference. Order<br />

specifies the order in which the NAPTR records must be processed to ensure the correct<br />

ordering of rules. Pref specifies the order in which NAPTR records with equal Order values<br />

should be processed, low numbers being processed before high numbers.<br />

Then, the system must make a TCP lookup to get SRV records for “_sip._tcp.mydomain.com”.<br />

An SRV RR answer may be:<br />

Priority Weight Port Target<br />

IN SRV 0 1 5060 server1.mydomain.com<br />

IN SRV 0 2 5060 server2.mydomain.com<br />

The records indicate that the system should send its request to server1. If there is no answer,<br />

server2 should be used. Note that the domain name “mydomain” can change between NAPTR<br />

records and SRV records.<br />

Once the protocol, the port and the domain have been resolved, the system should determine<br />

the IP address of the server. The system performs DNS A query (or AAAA for IPV6) related to<br />

“server1.mydomain.com” to get a list of IP addresses.<br />

The system should try the first SRV RR record. If no answer, the next in the list should be<br />

queried until the end of the list.<br />

If no SRV records were found, the system has to perform DNS A query (or AAAA for IPV6) on<br />

the domain name.<br />

If a port is specified in the URI (example : 1234@mydomain.com:5060), then the system has<br />

6-34

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!