[OpenSIPS-Users] disable dns lookup:

Liviu Chircu liviu at opensips.org
Thu Apr 9 17:14:37 CEST 2015


Hi chow,

OpenSIPS is performing the SRV DNS lookup because the underlying C 
library function (man res_search) DOES NOT read from /etc/hosts.

In order to skip any DNS lookup with t_uac_dlg [1], you must specify a 
NEXT HOP IP (3rd parameter). Now comes the tricky part:

* if you are working with bash, you cannot use "host" and "dig". Only 
the following commands will read from /etc/hosts, without additional SRV 
lookups:
     - getent ahostsv4 voip.test.com | awk '{print $1}' | sort -u
     - resolveip -s voip.test.com (NOTE: command comes with mysql-server 
package)

* if you're working with another language, good luck :)

This is how the MI message should look like:

      :t_uac_dlg:
      MESSAGE
      sip:1617 at voip.test.com
      XXX.XXX.XXX.XXX <- resolve "voip.test.com" by yourself here
      .
     "From: sip:test_server at voip.test.com
      To: sip:1617 at voip.ronghe.tv
      Content-Type: Multipart/Related"


[1] http://www.opensips.org/html/docs/modules/2.2.x/tm#id295949

Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 08.04.2015 10:12, chow wrote:
> Hi:
>       have a  problem , I can not fix it.
>       I have a domain in my sip server that is voip.test.com.
>
>       In my /etc/hosts have :
>       192.168.1.1  voip.test.com
>        
>       our opensips linsten : 192.168.1.1:5060 (protocol use tcp)
>
>        In my opensips.cfg have:
>        auto_aliases=yes
>        alias=localhost
>        alias=localhost.localdomain
>        alias=voip.test.com:5060
>          
>        dns=no
>        dns_retr_time=1
>        dns_retr_no=3
>        dns_try_ipv6=no
>        disable_dns_blacklist=yes
>        disable_dns_failover=no
>        dns_use_search_list=no
>        rev_dns=no
>
>        loadmodule "domain.so"
>        ####Database mode: 0 means non-caching, 1 means caching.
>        modparam("domain", "db_mode", 1)
>
>       I call the mi interface from other server, then opensips received
> message,
>       it alwasys do dns lookup for voip.test.com.
>       why opensips do this, how can I disable dns lookup
>        
>       mi message as below:
>       :t_uac_dlg:
>       MESSAGE
>       sip:1617 at voip.test.com
>       .
>       .
>      "From: sip:test_server at voip.test.com
>       To: sip:1617 at voip.ronghe.tv
>       Content-Type: Multipart/Related"
>
>       please, give me some suggestion!!! thanks a lot
>
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/disable-dns-lookup-tp7596381.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list