<p>It seems like opensips when using SRV records does not read and use the ADDITIONAL RECORDS, and instead sends another DNS request to get the IP for the host, which is inefficient and could be supported just like mentioned in the <a href="https://www.ietf.org/rfc/rfc2782.txt">RFC 2782</a> :</p>

<pre><code>For each element in the new list

  query the DNS for address records for the Target or
  use any such records found in the Additional Data
  section of the earlier SRV response.
</code></pre>

<p>Example, for our <code>_sip._udp</code> service using our service discovery tool : </p>

<pre><code>;; ANSWER SECTION:
_sip._udp.service.consul. 15  IN  SRV 1 1 5063 ourserver.node.us.consul.
_sip._udp.service.consul. 15  IN  SRV 1 1 5060 ourserver.node.us.consul.
_sip._udp.service.consul. 15  IN  SRV 1 1 5062 ourserver.node.us.consul.
_sip._udp.service.consul. 15  IN  SRV 1 1 5061 ourserver.node.us.consul.

;; ADDITIONAL SECTION:
ourserver.node.us.consul. 15 IN A 98.XXX.XXX.XXX
</code></pre>

<p>It has all the information it needs but it still does an extra <code>A</code> query, which is an issue for us as some of our services run on different interfaces. I'm looking at <code>resolve.c</code> and trying to see how this can be implemented (<a href="https://github.com/kamailio/kamailio/blob/master/resolve.c#L933-L954">See how Kamailio is doing it for example</a>) but I've ran into issues with the dns_cache. Any thoughts or anyone that would like to take on this issue?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/675">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciTjXKV9e_L43TcHWEvqxVKukWS25ks5o7d4xgaJpZM4GOZsU.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/OpenSIPS/opensips/issues/675"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>