ADNS Records Not In Cache

8 views
Skip to first unread message

Esra Hatice Yılmaz

unread,
Nov 2, 2022, 10:14:44 AM11/2/22
to prosody-dev
Hello,

Is there any specific configuration for DNS on prosody? I have been calling  a webservice from prosody. I defined the webservice URL as abc.com. According to prosody logs abc.com is never cached and always been trying to resolve from DNS every time. 

Thanks,
Esra

Nov  2 14:00:24  debug prosody[3880356]: http: Making HTTP GET request 'e7a01f0' to http://abc.com
Nov  2 14:00:24  debug prosody[3880356]: net.connect: [pending connection J7JtdHdJ] Starting connection process
Nov  2 14:00:24  debug prosody[3880356]: net.connect: [pending connection J7JtdHdJ] Checking for targets...
Nov  2 14:00:24  debug prosody[3880356]: adns: Records for abc.com not in cache, sending query (thread: 0x12fa8540)...
Nov  2 14:00:24  debug prosody[3880356]: server_epoll: Watching FD 476 (dns, 53, 0.0.0.0, 0)
Nov  2 14:00:24  debug prosody[3880356]: adns: Sending DNS query to 10.218.128.140
Nov  2 14:00:24  debug prosody[3880356]: adns: Records for abc.com not in cache, sending query (thread: 0x9580740)...
Nov  2 14:00:24  debug prosody[3880356]: adns: Sending DNS query to 10.218.128.140
Nov  2 14:00:24  debug prosody[3880356]: runnerZYTYMmjo: changed state from ready to waiting
Nov  2 14:00:24  debug prosody[3880356]: adns: Reply for abc.com (thread: 0x9580740)
Nov  2 14:00:24  debug prosody[3880356]: server_epoll: Close FD 476 (dns, 53, 0.0.0.0, 0) now
Nov  2 14:00:24  debug prosody[3880356]: server_epoll: Unwatched FD 476 (dns, 53, 0.0.0.0, 0)
Nov  2 14:00:24  debug prosody[3880356]: adns: Reply for abc.com (thread: 0x12fa8540)
Nov  2 14:00:24  debug prosody[3880356]: net.connect: [pending connection J7JtdHdJ] Next target to try is 1.1.1.1:8080
Nov  2 14:00:24  debug prosody[3880356]: server_epoll: Watching FD 476 (1.1.1.1, 53808)
Nov  2 14:00:24  debug prosody[3880356]: net.connect: [pending connection J7JtdHdJ] Successfully connected

Kim Alvefur

unread,
Nov 4, 2022, 10:42:13 AM11/4/22
to proso...@googlegroups.com
Hi,

On Wed, Nov 02, 2022 at 07:13:27AM -0700, Esra Hatice Yılmaz wrote:
>Is there any specific configuration for DNS on prosody?

There is some configuration possibilities for the new libunbound based
DNS backend, but not for the older net.dns / adns.

> I have been calling a webservice from prosody. I defined the
> webservice URL as abc.com. According to prosody logs abc.com is never
> cached and always been trying to resolve from DNS every time.

This happens because a DNS resolver instance is created for each
connection attempt. This is meant to prevent DNS cache poisoning.

Prosody will usually be talking to a caching resolver, so the need for a
local cache inside Prosody itself is limited. Especially since with XMPP
server-to-server connections, the main use of DNS in Prosody, these tend
to be long-lived and any cached records would likely not be used again.

I would recommend that you install lua-unbound and ensure you're on
Prosody 0.12+. With lua-unbound, Prosody uses single long-lived
libunbound resolver instance with its own cache.

--
Kim "Zash" Alvefur
Reply all
Reply to author
Forward
0 new messages