Home » Asterisk Users » SIP DNS SRV
Asterisk Users 17 Comments

Hello list.

When using SIP DNS SRV to define a production Asterisk server with high
priority and a backup Asterisk server with a lower priority on this
DNS-server, will this work as follow :

– production server is reachable, so registration of the IP-phone goes
to this server
– production server is unreachable, so registration goes to the backup
Asterisk server
– production server is reachable again, so registration goes back to the
production server


Do I need a low REGISTER timeout value for this to work ? Something like
60seconds, so the IP-phones register every 60 seconds…

Kind regards,

17 thoughts on - SIP DNS SRV

  • Yes that is the way it is supposed to work. You do have to rely on the
    sip devices you are using fully supporting SRV records though.

    Jonas Kellens wrote:

  • Hello,

    I know YeaLink for example supports this…

    Can you tell me for sure that when the production Asterisk server
    becomes reachable again, the registration will go back to the production
    server ??


  • Yes if you set the production server to a higher priority then the
    backup then the RFC states that the client should periodically check and
    switch back to the primary server is it becomes reachable.

    Jonas Kellens wrote:

  • Hi!

    This can also be done without SRV records if you have phones that provide
    a fallback SIP registrar entry – snom for example does, and many other
    vendors do to.


  • To be clear: I need to set the SRV record on my DNS-server and not on my
    Asterisk server ?!

    Because the people @ YeaLink keep on talking about “Your SIP server
    needs to support this”…


  • Hello,

    DNS SRV is not really working: when I stop the Asterisk proces on my
    production server, then the SIP phone is not registering to my backup
    SIP server.

    I have the following DNS records :

    sip2.domain.tld. A YY.YY.YY.YY
    sip.domain.tld. A XX.XX.XX.XX

    _SIP._udp.sip2.domain.tld. SRV YY.YY.YY.YY.
    _SIP._udp.sip.domain.tld. SRV XX.XX.XX.XX.

    _udp.sip2.domain.tld has a priority of 25
    _udp.sip.domain.tld has a priority of 5


  • You don’t understand SRV. You should have then both with the same name.

    And then point the phone at sip.domain.tld. Otherwise how would it know to use the other one? It’s a different name.


  • Those SRV records are wrong. You have to specify both servers with
    different priorities against the same hostname. You have sip and sip2
    defines with different SRV records so whichever one you configure on the
    phone thats the only record it will seen.
    You should use something like this and configure the phones to use
    sip.domain.tld. :-

    sip2.domain.tld. A YY.YY.YY.YY
    sip1.domain.tld. A XX.XX.XX.XX

    _SIP._udp.sip.domain.tld SRV 0 1 5060 sip1.domain.tld.
    _SIP._udp.sip.domain.tld SRV 1 1 5060 sip2.domain.tld.

    Jonas Kellens wrote:

  • Hello,

    can a SRV record and an A record co-exist ?

    Can I have both :

    sip.domain.tld. A XX.XX.XX.XX
    _SIP._udp.sip.domain.tld SRV 0 1 5060 sip1.domain.tld.

    Will IP-phones that support DNS SRV take the SRV-record and phones that
    do not support DNS SRV the A-record ?

    If I only have :
    _SIP._udp.sip.domain.tld SRV 0 1 5060 sip1.domain.tld.
    _SIP._udp.sip.domain.tld SRV 0 1 5060 sip2.domain.tld.

    what will happen with IP-phones that do not support DNS SRV when they
    register to sip.domain.tld ???

    Kind regards,

  • Hello,

    I’m having no succes with these SRV records (using Plesk at my hosting

    I have for example A-records :

    (name – TTL – Type – Priority – Value)
    sip1.domain.tld. 600 A XX.XX.XX.XX
    sip2.domain.tld. 600 A XX.XX.XX.XX

    and then SRV-records :

    (name – TTL – Type – Priority – Value)
    _SIP._udp.sip10.domain.tld. 600 SRV 5 sip1.domain.tld
    _SIP._udp.sip10.domain.tld. 600 SRV 25 sip2.domain.tld

    but this does not work with my Grandstream GXP2010.

    I then try this :

    (name – TTL – Type – Priority – Value)
    sip10._udp.domain.tld. 600 SRV 5 sip1.domain.tld
    sip10._udp.domain.tld. 600 SRV 25 sip2.domain.tld

    but this does not work either with my Grandstream GXP2010.

    Kind regards,

  • Hello,

    SIP DNS SRV records are not working.

    My Grandstream uses the SRV records to find the first Asterisk server to
    register to. This works.

    But when I shut down the Asterisk proces on server 1 and I restart my
    GXP 2010, the phone does not register to server 2… No mather how long
    I wait, there is no registration coming in…

    When I start the Asterisk proces again on server 1, then here
    registration comes in.

    Kind regards,

  • More info :

    [Jonas@jonas ~]$ host -t srv _SIP._udp.sip10.domain.tld
    _SIP._udp.sip10.domain.tld has SRV record 25 10 5060 sip2.domain.tld.
    _SIP._udp.sip10.domain.tld has SRV record 5 10 5060 sip1.domain.tld.

  • Jonas Kellens wrote:

    It sounds like the grandstream phones are not fully compliant with the
    SRV standard. They are probably just looking for the lowest priority
    entry and hardcoding that to be used all the time internally.

    If you restart the phone does it work?
    It might try the 25 priority entry if it cannot initially contact the
    primary server.

  • The way I test it :

    – Grandstream turned off.
    – Turn on Grandstream (power up)

    Conclusion :
    Grandstream does not register. No register coming in on server2.

    Finally :
    – Start Asterisk again on server1 (/sbin/service asterisk start)

    Conclusion :
    Grandstream registers to server1.


  • Jonas Kellens wrote:

    Then it looks like the Grandstream phone dont fully support DNS SRV.
    maybe a firmware update will fix it.