Hey Folks,
Running kamailio 5.8.4, haven't needed or used DNS functions previously but recently completed clearip integration, which requires sip request to use URL instead of IP and resolve where to send request. Within hours of adding URL lookups I started getting dns_hash unlinked errors. I correlated the log errors to when the URL changed IP. I assume the caching is working because kamailio sends to the same IP for a few minutes, then switches IP, sends to new IP for a few minutes, then switches IP again and this activity continues.
Here are some log errors:
switch IP Jun 10 14:14:17 siprouter1-pve186 /usr/local/sbin/kamailio[8111]: WARNING: <core> [core/dns_cache.c:170]: dns_hash_put(): unlinked item 0x7fa0f9b9fcc0 Jun 10 14:14:19 siprouter1-pve186 /usr/local/sbin/kamailio[8122]: WARNING: <core> [core/dns_cache.c:185]: dns_hash_put_shm_unsafe(): unlinked item 0x7fa0f9b9fcc0
switch IP Jun 10 14:15:00 siprouter1-pve186 /usr/local/sbin/kamailio[8111]: WARNING: <core> [core/dns_cache.c:170]: dns_hash_put(): unlinked item 0x7fa0f9b9ee00 Jun 10 14:15:03 siprouter1-pve186 /usr/local/sbin/kamailio[8122]: WARNING: <core> [core/dns_cache.c:185]: dns_hash_put_shm_unsafe(): unlinked item 0x7fa0f9b9ee00
switch IP Jun 10 14:15:33 siprouter1-pve186 /usr/local/sbin/kamailio[8110]: WARNING: <core> [core/dns_cache.c:170]: dns_hash_put(): unlinked item 0x7fa0f9b8e640 Jun 10 14:15:33 siprouter1-pve186 /usr/local/sbin/kamailio[8122]: WARNING: <core> [core/dns_cache.c:185]: dns_hash_put_shm_unsafe(): unlinked item 0x7fa0f9b8e640
switch IP Jun 10 14:20:37 siprouter1-pve186 /usr/local/sbin/kamailio[8109]: WARNING: <core> [core/dns_cache.c:170]: dns_hash_put(): unlinked item 0x7fa0f9b3eb60
switch IP Jun 10 14:21:12 siprouter1-pve186 /usr/local/sbin/kamailio[8117]: WARNING: <core> [core/dns_cache.c:170]: dns_hash_put(): unlinked item 0x7fa0f9b830f0 Jun 10 14:21:23 siprouter1-pve186 /usr/local/sbin/kamailio[8122]: WARNING: <core> [core/dns_cache.c:185]: dns_hash_put_shm_unsafe(): unlinked item 0x7fa0f9b830f0
Here are my DNS config parameters, nothing I've changed made any difference. And as far as I can tell I'm not dropping any clearip queries. dns=no rev_dns=no use_dns_failover=on dns_try_ipv6=no
I did find a patch update for this error back from 2023 and the patch is in my /src/core/dns_cache.c as expected but still getting errors.
Any guidance in clearing this error?
Thanks. JR
On Jun 10, 2025, at 4:00 PM, JR Richardson via sr-users sr-users@lists.kamailio.org wrote:
Hey Folks,
Running kamailio 5.8.4, haven't needed or used DNS functions previously but recently completed clearip integration, which requires sip request to use URL instead of IP and resolve where to send request. Within hours of adding URL lookups I started getting dns_hash unlinked errors. I correlated the log errors to when the URL changed IP. I assume the caching is working because kamailio sends to the same IP for a few minutes, then switches IP, sends to new IP for a few minutes, then switches IP again and this activity continues.
Here are some log errors:
switch IP Jun 10 14:14:17 siprouter1-pve186 /usr/local/sbin/kamailio[8111]: WARNING: <core> [core/dns_cache.c:170]: dns_hash_put(): unlinked item 0x7fa0f9b9fcc0 Jun 10 14:14:19 siprouter1-pve186 /usr/local/sbin/kamailio[8122]: WARNING: <core> [core/dns_cache.c:185]: dns_hash_put_shm_unsafe(): unlinked item 0x7fa0f9b9fcc0
switch IP Jun 10 14:15:00 siprouter1-pve186 /usr/local/sbin/kamailio[8111]: WARNING: <core> [core/dns_cache.c:170]: dns_hash_put(): unlinked item 0x7fa0f9b9ee00 Jun 10 14:15:03 siprouter1-pve186 /usr/local/sbin/kamailio[8122]: WARNING: <core> [core/dns_cache.c:185]: dns_hash_put_shm_unsafe(): unlinked item 0x7fa0f9b9ee00
switch IP Jun 10 14:15:33 siprouter1-pve186 /usr/local/sbin/kamailio[8110]: WARNING: <core> [core/dns_cache.c:170]: dns_hash_put(): unlinked item 0x7fa0f9b8e640 Jun 10 14:15:33 siprouter1-pve186 /usr/local/sbin/kamailio[8122]: WARNING: <core> [core/dns_cache.c:185]: dns_hash_put_shm_unsafe(): unlinked item 0x7fa0f9b8e640
switch IP Jun 10 14:20:37 siprouter1-pve186 /usr/local/sbin/kamailio[8109]: WARNING: <core> [core/dns_cache.c:170]: dns_hash_put(): unlinked item 0x7fa0f9b3eb60
switch IP Jun 10 14:21:12 siprouter1-pve186 /usr/local/sbin/kamailio[8117]: WARNING: <core> [core/dns_cache.c:170]: dns_hash_put(): unlinked item 0x7fa0f9b830f0 Jun 10 14:21:23 siprouter1-pve186 /usr/local/sbin/kamailio[8122]: WARNING: <core> [core/dns_cache.c:185]: dns_hash_put_shm_unsafe(): unlinked item 0x7fa0f9b830f0
Here are my DNS config parameters, nothing I've changed made any difference. And as far as I can tell I'm not dropping any clearip queries. dns=no rev_dns=no use_dns_failover=on dns_try_ipv6=no
I did find a patch update for this error back from 2023 and the patch is in my /src/core/dns_cache.c as expected but still getting errors.
Any guidance in clearing this error?
Thanks. JR
Not an answer to your question, but to use failover, use_dns_cache (I believe) needs to be on.
https://github.com/kamailio/kamailio/blob/master/doc/tutorials/dns.txt
Fred Posner Tel: +1 (352) 664-3733 Alt: +1 (224) 334-3733
Contact info at https://fredp.xyz