Twillio and SRV

Created: 5/2015.  Last Updated: 1/2018


Twilio does not support RFC 3263, Locating SIP Servers. This is a standard way of locating SIP servers via SRV record lookup. Twilio, however, only attempts to resolve domains via A records, which is incompatible with OnSIP's distributed nature.

You can use a dig command to look up the SRV record for your SIP domain:

> dig SRV

;; ANSWER SECTION: 86400 IN SRV 0 0 5060

---, in turn, is resolved via GeoDNS to provide a reliable, distributed service entry point. 

There is, however, a work-around with a little bit of effort. 

What you would do is migrate your OnSIP domain to be the same as your primary domain (e.g.  Then, your SIP address would be:
as opposed to what it is now:
You accomplish this by adding an SRV record to your DNS and then in the OnSIP portal choosing the "migrate my domain" setting.  More details can be found here:
Note:  Trying to resolve the DNS address to an IP address will not work.  username@ipAddress will not work in a multi-hosted environment like OnSIP.




If you migrate your A-record domain to OnSIP, that does appear to work.  Since your domain has an A-record, Twilio will then do an SRV record lookup.  This is still backwards. They should attempt an SRV record lookup irrespective of whether or not an A-record exists.  

Was this article helpful?
0 out of 0 found this helpful


  • Avatar
    Mike Oeth

    Unfortunately that won't quite work. The result would be username@ for example. But usernames aren't unique in a multi-domain environment. What is unique is username@domain.