[OpenSIPS-Users] DNS lookup question - Domain URI appended by local domain attempts on SRV lookup

Bogdan-Andrei Iancu bogdan at opensips.org
Tue Dec 18 11:28:39 EST 2018


Hi Jock,

If you simply want to bypass any NATPR and SRV lookup and force only the 
A lookup, you can trick this by adding a port to the URI. According to 
RFC 3263 ( Locating SIP Servers), if port is present, only A lookup must 
be done.

Try doing setport("5060"); and see how it goes.

Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Summit 2019
   https://www.opensips.org/events/Summit-2019Amsterdam/

On 12/07/2018 12:14 AM, Jock McKechnie wrote:
> Good afternoon;
>
> We have a few customers that we send calls to their network by domain
> name - for example, sip:alice at server01.customer123.com.
>
> OpenSIPS' default behaviour is to initially look for an SRV record and
> then if it cannot locate one, to search for an A record. This is the
> correct behaviour, of course.
>
> In our example, let us assume the Fully Qualified Domain Name of the
> OpenSIPS server is: handoff.rackA.datacentreB.provider.com
> And, further, that this customer does not have an SRV record and only
> an A record.
>
> What I have discovered is that OpenSIPS follows a DNS lookup pattern like this:
> Query ServerA: SRV? _sip._udp.server01.customer123.com. (NXDOMAIN)
> Query ServerB: SRV? _sip._udp.server01.customer123.com. (NXDOMAIN)
> (up to dns_retr_no times)
> Query ServerA: SRV?
> _sip._udp.server01.customer123.com.rackA.datacentreB.provider.com.
> (SERVFAIL)
> Query ServerB: SRV?
> _sip._udp.server01.customer123.com.rackA.datacentreB.provider.com.
> (SERVFAIL)
> (up to dns_retr_no times)
> Query ServerA: A? server01.customer123.com (A: 10.10.10.123)
>
> At which point, at least in my example, we now get a valid A record back.
>
> Unfortunately there's a twist here - while searching for the SRV of
> the customer domain gets an NXDOMAIN, which is cached appropriately by
> the resolvers, the combined "destination+local" address
> (_sip._udp.server01.customer123.com.rackA.datacentreB.provider.com)
> does not for reasons I am unsure of, and instead gets a SERVFAIL. This
> is *not* cached and subsequently for every single lookup we're getting
> some not insignificant delays - worse yet, we've just added a whole
> bunch of nameservers which have made it bad enough we've noticed it.
> We could reduce the number of nameservers we query (Thank you,
> dns_servers_no) but we want to give best chance that we can do a
> successful DNS lookup (and faulty resolvers have recently bitten us).
>
> I need DNS look up, and I need SRV look up to happen. But there will
> *never* be a case where we will pass a call to a local destination
> that needs the local domain name to be tacked onto it. Is there any
> way to not do this? To search for
> "_sip._udp.server01.customer123.com." and then skip right to the A
> record?
>
> It's entirely possible this is done somewhere inside libresolv and
> it's completely outside of OpenSIPS' control, but I wanted to ask in
> case I'm just completely missing it in the 'core parameters'
> documentation.
>
> As always, my thanks for your time;
>
>   - Jock
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list