[Asterisk-Users] DNS SRV records

John Fraizer tvo at enterzone.net
Wed Jun 2 11:16:25 MST 2004


Duane wrote:

> John Fraizer wrote:
> 
>> Spoken like a true n00b13.
> 
> 
> If the current SIP bug isn't annoying enough to push people away from 
> asterisk you just have to chip in your 2 cents worth to push things that 
> little bit more...
> 
>> You can *sometimes* get away with not having MX records.  You can 
>> *sometimes* get away with not having SVR records.  Both record types 
>> exist for a reason though.
> 
> 
> Oh so that's why SRV lookups are commented out in the default asterisk 
> config, so you can't get anything?
> 
> sip://username@***HOSTNAME*** works perfectly well... Before you berate 
> others indescriminately remove your foot from your mouth next time so 
> you don't look like as big of an ass next time...
> 

OK Son,

Since you decided to keep this on the list, I will too.

MX and SRV records are used to determine the appropriate handler(s) for:

domain.name
qualified.domain.name
fully.qualified.domain.name
more.fully.qualified.domain.name
even.more.fully.qualified.domain.name

For example, if you had the following in the DNS zone for "domain.name":

$ORIGIN NAME.
DOMAIN		IN      NS      your.name.server.
                 IN      NS      your.other.name.server.
                 IN      A       10.1.1.1
                 IN      MX      10 your.mail.exchanger.
                 IN      MX      20 your.other.mail.exchanger.
		IN	SOA	your.name.server. dnsadmin.your.domain.(
         200403059
         10800
         3600
         604800
         300
)
$ORIGIN DOMAIN.NAME.
_sip._udp	SRV	10	10   5060   1.your.sipproxy.domain.name.
_sip._udp	SRV	10	20   5060   2.your.sipproxy.domain.name.
_sip._udp	SRV	20	10   5060   3.your.sipproxy.domain.name.

1.your.sipproxy	IN	A	192.168.1.1
2.your.sipproxy	IN	A	192.168.1.2
3.your.sipproxy	IN	A	192.168.1.3



Email to you at domain.name would be processed by "your.mail.exchanger" and 
not sent to "domain.name" at it's A record.  The same goes for email to 
you at even.more.fully.qualified.domain.name.  In the event that 
your.mail.exchanger was down, mail would be handled by 
your.other.mail.exchanger.

The purpose of the MX record is to be able to point the SMTP service 
responsibility at a host OTHER than the FQDN that is being referenced in 
the email.

The same works for SRV records.  In the above example, if someone dialed 
the URL "you at domain.name", the SIP INVITE would first be sent to either 
"1.your.sipproxy.domain.name" at 192.168.1.1 or 
"2.your.sipproxy.domain.name" at 192.168.1.2 (with the first one getting 
the larger percentage of use based on its weight entry) and not to 
domain.name at 10.1.1.1.  If a sipproxy can't be reached at 192.168.1.1 
or 192.168.1.3, the SIP INVITE will be sent to 
"2.your.sipproxy.domain.name" at 192.168.1.3 based on it's priority as a 
backup to the first two entries.

These records exist so that services can be hosted on machines OTHER 
than the machine that matches "domain.name".  They also allow for fail 
over in the event of failure of a server or service.

It also allows you to point a service at a machine or group of machines 
without having to give every person a new email address or SIP URL to use.

Next benefit: Say you have "big-fat-server.your.domain.name" and every 
person on the planet uses "you at big-fat-server.your.domain.name" as your 
email address and SIP URL.  Now, you decide that you want to split the 
tasks of email and SIP proxy off of "big-fat-server.your.domain.name" 
and on to their own dedicated servers.

With MX and SRV records, this is a matter if simply updating the record 
appropriate record.  Without those records, you now have to tell people 
that to send you email, they have to use 
"you at your-new-email-server.your.domain.name" and to call you over VOIP, 
they have to use "you at your-new-sipproxy.your.domain.name".  Kinda 
hokey... Huh.  That's why we have MX records and SRV records.  With 
these records set up properly, people can both email and call you over 
VOIP at the same place, "you at domain.name".  Hrm.  That seems a bunch 
easier than remembering what the name to your mailserver and/or sipproxy 
are, doesn't it.

So, decide for yourself folks.  Do you want to do it the n00b1e way or 
do you want to do it right the first time and be done with it?

Now.  On the matter of who made an ass of them self, I think you should 
take a close look in the mirror because it was most certainly not I.

--
John "not a n00b13" Fraizer





More information about the asterisk-users mailing list