[systemd-devel] [RFC] systemd-resolved: Send d-bus signal after DNS resolution

Lennart Poettering lennart at poettering.net
Wed Feb 16 17:52:50 UTC 2022


On Di, 15.02.22 22:37, Suraj Krishnan (surajkr at microsoft.com) wrote:

> Hello,
>
> I'm reaching out to the community to gather feedback about a feature
> to broadcast a d-bus signal notification from systemd-resolved when
> a DNS query is completed. The message would contain information
> about the query and IP addresses received from the DNS server.

Broadcasting this on the system bus sounds like a bit too heavy. I am
sure there are setups which will resolve a *lot* of names in a very
short time, and you'd flood the bus with that. D-Bus is expressly not
built for streaming more than control data, but if you have a flood of
DNS requests it becomes substantially more than that.

Also, given that in 99.9%of all cases the broadcast messages would
just be dropped by the broker because nothig is listening this sounds
needlessly expensive.

What would make sense is adding a Varlink interface for this
however. resolved uses varlink anyway it could just build on
that. Varlink has the benefit that no broker is involved: if noone is
listening we wouldn't do anything and not have to pay for it. Moreover
varlink has no issues with streaming large amounts of data. And its
easy to secure to ensure nobody unprivileged will see this (simply by
making the socket have a restrictive access mode).

So yes, i think adding the concept makes a ton of sense. But not via
D-Bus, but via Varlink. Would love to review/merge a patch that adds
that and then exposes this via "resolvectl monitor" or so.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list