Module: kamailio
Branch: 6.0
Commit: 28686b3561e5612f0b3e4ae86f7573747a06559d
URL: 
https://github.com/kamailio/kamailio/commit/28686b3561e5612f0b3e4ae86f7573747a06559d

Author: Matteo Brancaleoni <[email protected]>
Committer: Henning Westerholt <[email protected]>
Date: 2026-01-05T11:59:31Z

dmq: Fix DNS resolution corruption when search list is used

When `dns_use_search_list=1` (the default), `get_record()` may prepend a "fake 
CNAME" record to map short hostnames to their expanded form.

(cherry picked from commit 787bbe5c91e9fc02f741fdd26b06ccad87b4c19e)

---

Modified: src/modules/dmq/notification_peer.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/28686b3561e5612f0b3e4ae86f7573747a06559d.diff
Patch: 
https://github.com/kamailio/kamailio/commit/28686b3561e5612f0b3e4ae86f7573747a06559d.patch

---

diff --git a/src/modules/dmq/notification_peer.c 
b/src/modules/dmq/notification_peer.c
index 0b8a41b3b91..1fd234e5aa4 100644
--- a/src/modules/dmq/notification_peer.c
+++ b/src/modules/dmq/notification_peer.c
@@ -227,6 +227,7 @@ int get_dmq_host_list(
        for(prec = phead; prec; prec = prec->next) {
                /**********
                * o check max
+               * o skip non-A records (e.g., CNAME)
                * o create URI
                **********/
 
@@ -235,6 +236,11 @@ int get_dmq_host_list(
                        free_rdata_list(phead);
                        return host_cnt;
                }
+               /* Skip non-A records - get_record may return CNAME records
+                * when DNS search list expansion is used */
+               if(prec->type != T_A) {
+                       continue;
+               }
                len = ip4tosbuf(
                                ((struct a_rdata *)prec->rdata)->ip, pIP, 
IP4_MAX_STR_SIZE);
                pIP[len] = '\0';

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to