Good day, i have noticed that janus process with libwebsockets plugin creates a DNS request for each websocket session and maintains it until the session is closed.
It can be seen as an active connexion from janus server to DNS server:
176.222.133.219 = Janus server
81.87.43.206 = Dns server
udp 0 0 176.222.113.219:49178 81.87.43.206:53 ESTABLISHED
udp 0 0 176.222.113.219:57383 81.87.43.206:53 ESTABLISHED
udp 0 0 176.222.113.219:32828 81.87.43.206:53 ESTABLISHED
udp 0 0 176.222.113.219:32832 81.87.43.206:53 ESTABLISHED
udp 0 0 176.222.113.219:57430 81.87.43.206:53 ESTABLISHED
udp 0 0 176.222.113.219:41048 81.87.43.206:53 ESTABLISHED
udp 0 0 176.222.113.219:36956 81.87.43.206:53 ESTABLISHED
udp 0 0 176.222.113.219:49300 81.87.43.206:53 ESTABLISHED
netstat give me this:
udp 0 0 janus-prod-1.com:52562 dns-resolver-1-v:domain ESTABLISHED
I did some testing, and if i disable a user session on janus, it immediately removes the corresponding maintained connexion to DNS.
By itself it is not a problem, but the local janus port is random, and sometimes it takes the port dedicated to Janus and in logs i see this kind of messages:
[Thu Jul 18 09:05:22 2024] [ERR] [plugins/janus_sip.c:janus_sip_allocate_local_ports:6750] Bind failed for audio RTP (port 53760), error (Address already in use), trying a different oneā¦
I dont understand why it is maintaining this socket to DNS so long, the only option i have found about libwebsockets and DNS is this option:
https://libwebsockets.org/lws-api-doc-v4.3-stable/html/md_READMEs_README_async_dns.html
It would not be a problem for me if it took a port from defined range, but currect behaviour leads to port conflicts
Do someone have any information on this DNS socket bind, and if it is normal ? (and how to handle it propertly ?)
Thank you