<!--
### Description
<!-- Kamailio goes unresponsive when it cannot resolve a DNS from siptrace We are using siptrace to integrate Kamailio with Homer and we have a DNS on the duplicate_uri field. We noticed that when Kamailio cannot resolve this domain it freezes and stops responding to SIP requests. -->
#### Reproduction ``` You can reproduce the issue by: 1) Enabling siptrace 2) Populating the duplicate_uri field with a non-existing domain 3) Sending test calls ``` #### Log Messages ``` 1(1164) CRITICAL: <core> [core/proxy.c:264]: mk_proxy(): could not resolve hostname: "homer7-hep.query.consul" 1(1164) ERROR: siptrace [siptrace_hep.c:177]: trace_send_hep3_duplicate(): bad host name in uri ```
### Additional Information ``` # /usr/local/sbin/kamailio -version version: kamailio 5.2.4 (x86_64/linux) a57138 flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: a57138 compiled on 14:41:20 Aug 21 2019 with gcc 6.3.0 ```
* **Operating System**: ``` LInux Debian Stretch Linux 4.4.0-109-generic #132-Ubuntu SMP Tue Jan 9 19:52:39 UTC 2018 x86_64 GNU/Linux ```
DNS is a blocking operation. If it takes long to get the reply from the dns server, then the Kamailio worker is blocked. Look on the wiki at the core cookbook, there are several core parameters related to dns, try to adjust them. Also, there are config options of the operating system for dns queries (preferences, timeout), you should check them as well and change the values to fit better your needs.
Now, to clarify, after you get the error message that the domain/hostname cannot be resolved, is Kamailio still not handling SIP requests?
Thanks for your response, we'll try to adjust the DNS parameters.
When we have this DNS issue Kamailio is unable to handle most of the SIP requests, the ones that Kamailio was able to handle had a significant delay (about 2-3 seconds)
I am closing this one, but if you discover that the issue is independent of DNS server slowness, reopen.
Closed #2081.