Would be unbound good candidate to replace systemd-resolved on desktop?

Hi,

I had a discussion with some our people involved in systemd development.
They would like some decision about RHEL 10 DNS subsystem. Of course
they would like to have systemd-resolved similar to Fedora or Ubuntu.

I on the other hand would like to have something following properly RFC
and standards. I think unbound is the closest match. It has good runtime
reconfiguration support. It knows even how to do DNS over TLS and can
switch to it runtime.

But is missing:

- integration with NM manager configuring split-DNS domains properly.
Similar to dns=dnsmasq configuration in NetworkManager.conf.
- ability to pass example.corp. names validation, if they exist on
forwarders provided by local network. Or any private TLD, such as .home
or .lan. Could be solved by disabling dnssec validation by default, just
like systemd-resolved.
- missing d-bus API to allow VPNs forwarders configuration and split-DNS
zones definition
- no mDNS or LLMNR support
- no custom NSS plugin (I think this is unimportant)
- no d-bus API offering asynchronous resolution to application (not sure
how much this is used)

I would like something not blocking DNSSEC records by default. Do you
think it is worth working on missing items? Would you recommend to
install unbound on all desktop installations by default? Why yes? Why
not? Do you see any blocker I haven't mentioned?

Any feedback would be welcomed!

Cheers,
Petr

Does no answer mean nobody would like unbound as a default DNS cache?
Does systemd-resolved fulfill your needs?

It appears that Petr Menšík via Unbound-users <pemensik@redhat.com> said:

Does no answer mean nobody would like unbound as a default DNS cache?

We FreeBSD users have had unbound as the default cache for a long time. Works great.

Does systemd-resolved fulfill your needs?

My eyes glazed after systemd.

R's,
John

I had a discussion with some our people involved in systemd development.
They would like some decision about RHEL 10 DNS subsystem. Of course
they would like to have systemd-resolved similar to Fedora or Ubuntu.

My experience with systemd and systemd-resolved people and bug handling lead me to say that systemd-resolved is unsuitable as the default resolver. All my use cases were deemed “out of scope” and there are crashes and RFC violations galore that are either closed as notabug or ignored.

They should ask “what needs to change so that systemd-resolved could become the system resolver”, and then take that input seriously. That was not the case when I was there trying to have that conversation.

I on the other hand would like to have something following properly RFC
and standards. I think unbound is the closest match. It has good runtime
reconfiguration support. It knows even how to do DNS over TLS and can
switch to it runtime.

It works for bsd as default resolver. It has a dedicated team and budget. It’s developers attend IETF and RIPE meetings and are closely involved with operational issues and protocol development. None of this is true for systemd-resolved.

But is missing:

- integration with NM manager configuring split-DNS domains properly.

We did it for libreswan, it’s trivial to add it to NM. It will have taken longer to write this email on my virtual phone keyboard. All the unbound-control commands were added for this, some specifically for this use case with libreswan at my request.

Similar to dns=dnsmasq configuration in NetworkManager.conf.
- ability to pass example.corp. names validation, if they exist on
forwarders provided by local network.

Instead of all this bad hacking, those developers should get involved with the IETF ADD working group and look at the drafts produced there for exactly how future protocols are supposed to fix this. Unbound or glue code will likely be written for this by dedicated dns developers.

Or any private TLD, such as .home
or .lan. Could be solved by disabling dnssec validation by default, just
like systemd-resolved.

Again, this is exactly why resolved is unsuitable. The thought that dnssec is optional is archaic. It shows disrespect to the users and results it more complicated setups where applications will ignore the system dns because it’s simply untrustworthy.

DNS will contain SVCB, HTTPS records to advertise dns transports and AliasMode replacing CNAMEs. It will contain SNI public keys for encrypted SNI. None of these records can be used securely when dnssec is disabled.

Systemd should stop hacking and look at what’s happening at the IETF. Everything is still in drafts and they can still influence based on their experience and use cases. They should stop forcing their own ideas and dropping real world use cases as they have done in the past. Fritzbox can be dealt with separately instead of making fake TLDs work a higher priority than actual proper DNS deployment.

- missing d-bus API to allow VPNs forwarders configuration and split-DNS
zones definition

That’s another way of saying NM integration. And isn’t dbus legacy and the new tool is varlink? (Lack of dbus integration in general is because the low level libdbus is wrong for this and all other higher level libs pulled in a graphical desktop dependencies)

- no mDNS or LLMNR support

LLMNR is dead isn’t it? And Avahi ran the .local stuff just fine?

- no custom NSS plugin (I think this is unimportant)

This is actually a bug. Systemd-resolved changes its answer based on whether gethostbyname() or getaddr_info() is used. One of the reasons I remove this from nsswitch.conf in all my systems.

- no d-bus API offering asynchronous resolution to application (not sure
how much this is used)

Resolving over dbus doesn’t seem like a very good idea. A varlink API shouldn’t be that hard. Not sure of the gain versus a connected TCP connection to the local host DNS server. Smells more like “not invented here” syndrome.

I would like something not blocking DNSSEC records by default. Do you
think it is worth working on missing items? Would you recommend to
install unbound on all desktop installations by default? Why yes? Why
not? Do you see any blocker I haven't mentioned?

Very very few people need mdns or LLMNR, especially on servers or containers. I like my enterprise DNS not optimizing for printer discovery or a developers need to reach a fake .box TLD to login to their router.

If I sound harsh, it’s because all of this is has happened before and all of this will happen again. Nothing fundamentally has changed with systemd-resolved in the last 7+ years.

I doubt this email or any of your efforts at Red Hat regarding DNS will change anything either but I applaud you for trying and reaching out to us. I hope I am wrong and you manage to ensure RHEL10 will have a solid system-wide DNS setup.

Thanks for trying Petr! I really do appreciate that.

Paul

Well, nothing is stopping anyone from using unbound as a DNS cache today. It seems that the only issue is making it “default”, which requires hacking on the systemd-resolved subsystem. I’m a big systemd supporter, but systemd should remain a service management layer, not try to re-implement some sort of per-service generic API for every possible service. What is next? A systemd-twitter subsystem to manage my twitter access in a generic way? And then rewrite all applications to use d-bus to send API calls to the systemd-twitter subsystem, which then translates those calls to to Twitter’s API? There is such a thing as too much abstraction.

  I also find NetworkManager totally unsuitable for servers, and I generally delete it. Its use case is really for laptops, which I don’t care about.

  And I don’t care about split DNS either. It isn’t a feature that I’d ever use, or recommend anyone else use. If you have to do split DNS, the capability already exists. No need to write a new abstraction to it.

Tom

Let me state first I am fan of DNSSEC and unbound. But some existing
networks do not allow them to work.

I had a discussion with some our people involved in systemd development.
They would like some decision about RHEL 10 DNS subsystem. Of course
they would like to have systemd-resolved similar to Fedora or Ubuntu.

My experience with systemd and systemd-resolved people and bug handling lead me to say that systemd-resolved is unsuitable as the default resolver. All my use cases were deemed “out of scope” and there are crashes and RFC violations galore that are either closed as notabug or ignored.

They obivously dislike DNSSEC and consider it breaking too many stuff.
Often their first advice is try turning DNSSEC off. Worked? Okay, close
the issue.

They should ask “what needs to change so that systemd-resolved could become the system resolver”, and then take that input seriously. That was not the case when I was there trying to have that conversation.

Even when I disagree with them in quite many things, they have working
resolver even in weird network situations. For example routerboard wifi
routers do not support EDNS0 or DNSSEC. If I have a laptop and connect
to such network, I would like to receive working resolution. That is not
as straight forward with unbound. With its default configuration it
would result in servfail and not working connectivity. I would recommend
anyone to request such network provider to fix the DNS cache/forwarder,
but such networks are not very uncommon. If unbound should be
preinstalled also on Laptops moving from network to network, this has to
be solved somehow.

I would recommend ability to set DNSSEC validation per connection in NM.
But anyway, this should be solved automatically if unbound would be
installed on every desktop.

I on the other hand would like to have something following properly RFC
and standards. I think unbound is the closest match. It has good runtime
reconfiguration support. It knows even how to do DNS over TLS and can
switch to it runtime.

It works for bsd as default resolver. It has a dedicated team and budget. It’s developers attend IETF and RIPE meetings and are closely involved with operational issues and protocol development. None of this is true for systemd-resolved.

Well, Red Hat pays many of systemd developers. It is not in the same
situation as dnsmasq for example. It has its developer base not small.
But I admit they do not follow DNS best practices very often. It should
be noted that there are also other name resolution methods on Linux
workstation. It is not just DNS, but also mDNS, LLMNR or various nss
plugins. I don't know whether there is any work group working with those
methods as well.

But is missing:

- integration with NM manager configuring split-DNS domains properly.

We did it for libreswan, it’s trivial to add it to NM. It will have taken longer to write this email on my virtual phone keyboard. All the unbound-control commands were added for this, some specifically for this use case with libreswan at my request.

It may not be hard, but there is no existing implementation for that I
would know about. For example OpenVPN announced they would like
dbus-only configuration of those forwarders.

Similar to dns=dnsmasq configuration in NetworkManager.conf.
- ability to pass example.corp. names validation, if they exist on
forwarders provided by local network.

Instead of all this bad hacking, those developers should get involved with the IETF ADD working group and look at the drafts produced there for exactly how future protocols are supposed to fix this. Unbound or glue code will likely be written for this by dedicated dns developers.

I have not read all ADD drafts. But do they solve how to direct name
queries to multiple resolvers when I am connected to multiple networks?
There are attempts to solve those problems right now somehow, even
before final standard is made. Example might be hack with ~ prefix to
search domains in DHCP. Then they are just added to local domains set
for a connection, but not into /etc/resolv.conf search clause.

Or any private TLD, such as .home
or .lan. Could be solved by disabling dnssec validation by default, just
like systemd-resolved.

Again, this is exactly why resolved is unsuitable. The thought that dnssec is optional is archaic. It shows disrespect to the users and results it more complicated setups where applications will ignore the system dns because it’s simply untrustworthy.

DNS will contain SVCB, HTTPS records to advertise dns transports and AliasMode replacing CNAMEs. It will contain SNI public keys for encrypted SNI. None of these records can be used securely when dnssec is disabled.

I am for ability to validate DNSSEC from every machine possible. However
some resolvers offered to network users do not allow it. Not only
resolved with DNSSEC=no is breaking it. If that is not important for a
network operator, okay. The user should have easy way to receive
notification this network does offer servers with working validation.
But it should work even in that case.

Systemd should stop hacking and look at what’s happening at the IETF. Everything is still in drafts and they can still influence based on their experience and use cases. They should stop forcing their own ideas and dropping real world use cases as they have done in the past. Fritzbox can be dealt with separately instead of making fake TLDs work a higher priority than actual proper DNS deployment.

- missing d-bus API to allow VPNs forwarders configuration and split-DNS
zones definition

That’s another way of saying NM integration. And isn’t dbus legacy and the new tool is varlink? (Lack of dbus integration in general is because the low level libdbus is wrong for this and all other higher level libs pulled in a graphical desktop dependencies)

Interesting. Not sure about that. The only user of varlink that I know
is resolved. I guess any generic enough API would work. But dbus
integration on workstation would still make sense.

- no mDNS or LLMNR support

LLMNR is dead isn’t it? And Avahi ran the .local stuff just fine?

- no custom NSS plugin (I think this is unimportant)

This is actually a bug. Systemd-resolved changes its answer based on whether gethostbyname() or getaddr_info() is used. One of the reasons I remove this from nsswitch.conf in all my systems.

Not sure what do you mean. Can you explain?

- no d-bus API offering asynchronous resolution to application (not sure
how much this is used)

Resolving over dbus doesn’t seem like a very good idea. A varlink API shouldn’t be that hard. Not sure of the gain versus a connected TCP connection to the local host DNS server. Smells more like “not invented here” syndrome.

I would like to move LLMNR and mDNS resolution to nss plugins only. But
there is no simple to use asynchronous API, which can request names
including nss plugins from application. If we insist on DNS, we end in
the same mess resolved now has. We have getdns library, which is nice.
But DNS specific. I think we miss a simple library or service, which can
provide getaddrinfo() library calls in non-blocking way and easily
integrated into desktop application.

Resolved has dbus resolve1 API [3], which seems too specific for
resolved. I don't like the API itself, but provides a way to
asynchronously resolve address without extra pain.

I would like something not blocking DNSSEC records by default. Do you
think it is worth working on missing items? Would you recommend to
install unbound on all desktop installations by default? Why yes? Why
not? Do you see any blocker I haven't mentioned?

Very very few people need mdns or LLMNR, especially on servers or containers. I like my enterprise DNS not optimizing for printer discovery or a developers need to reach a fake .box TLD to login to their router.

I understand servers rarely need LLMNR. It breaks too many things in
current systemd-resolved implementation. Filled [1] recently, but I
doubt they would change it enough.

Anyway, if I configure root forwarders to some local server and it can
respond to 'machine.example.' query with unsigned content, it is quite
lame if my unbound turns that response to NXDOMAIN, because example. is
proven non-existent at root. That server obviously knows it. If that
domain is immediately above root, there is no danger just accepting this
with NTA exception IMO. Many existing networks misuse some kind of
private TLD. If we want unbound with DNSSEC enabled to be a default, it
should not break on every such network, where it worked for years
before. Of course they should be told to get and use own domain. There
is not a small collection, which might be accepted by default [2].

Of course if it is in iterative mode without forwarding, there is no
reason to accept such responses. If root servers are signed, they know
what belongs there.

If I sound harsh, it’s because all of this is has happened before and all of this will happen again. Nothing fundamentally has changed with systemd-resolved in the last 7+ years.

Well, something can be changed via Merge Requests to systemd. But they
have own ideas how it is correct.

I doubt this email or any of your efforts at Red Hat regarding DNS will change anything either but I applaud you for trying and reaching out to us. I hope I am wrong and you manage to ensure RHEL10 will have a solid system-wide DNS setup.

Thanks for trying Petr! I really do appreciate that.

Paul

My efforts can change something. But fact is systemd team has more
developers and I am alone again in our Infrastructure Services team on
DNS related products for RHEL. In fact systemd maintainer asked me for a
requirements summary on modern system. Any idea for a good mailing list
for that question? Or working group? Except what we already discussed, I
think easy registration of local hostnames would be useful. As a
replacement for libvirt-nss plugin, which provides names only via
getaddrinfo calls. Unless I have something equivalent or better than
systemd-resolved, I am afraid the resolution implementation in next
major RHEL release would become resolved.

So if that should ever change, I think also implementations have to be
done. Not just discussion. Unbound is great, but would need a more plug
& play feel if offered also to non-techical people. :slight_smile:

Cheers,
Petr

1. https://github.com/systemd/systemd/issues/23494
2. https://observatory.research.icann.org/graph-m4.html
3.
https://www.freedesktop.org/software/systemd/man/org.freedesktop.resolve1.html#

  Well, nothing is stopping anyone from using unbound as a DNS cache today. It seems that the only issue is making it “default”, which requires hacking on the systemd-resolved subsystem. I’m a big systemd supporter, but systemd should remain a service management layer, not try to re-implement some sort of per-service generic API for every possible service. What is next? A systemd-twitter subsystem to manage my twitter access in a generic way? And then rewrite all applications to use d-bus to send API calls to the systemd-twitter subsystem, which then translates those calls to to Twitter’s API? There is such a thing as too much abstraction.

Agreed. systemd as services management services is great. but
implementation of every system part in systemd is very wrong. resolved,
networkd, timesyncd. I don't understand why they put it all into a
single project.

  I also find NetworkManager totally unsuitable for servers, and I generally delete it. Its use case is really for laptops, which I don’t care about.

NM is default also on recent RHELs, which target more servers than
workstations. I think it is not so bad, it has its own advantages. I
admit it is much better on laptops or workstations. But it is considered
the best uniform interface to network configuration on RHEL. When you
include vlans or more difficult configurations, alternatives seem to be
too much scattered.

  And I don’t care about split DNS either. It isn’t a feature that I’d ever use, or recommend anyone else use. If you have to do split DNS, the capability already exists. No need to write a new abstraction to it.

I maintain bind9, unbound and dnsmasq on RHEL and Fedora. They all have
ability to send queries for different names to different servers. But
they all need very different configuration steps. While it is not a
problem on server, where its configuration does not change often, it is
different on mobile devices. I don't want to reconfigure my laptop, when
I take it home from work or the other way around. Let alone using it in
public transport of café. I search for a way to obtain required
information from network configuration and pass it to any capable
service to configure it properly. I found a way to do that using
openresolv, but that is quite clumsy.

dnsmasq NM plugin is another way. It works with NM only, but that is the
only supported option for us anyway. It already integrates with
systemd-resolved. It could and should work with unbound. It could create
include snippet for bind9, but I doubt that would be used often.
knot-resolver or pdns-recursor might be better alternatives. But I am
not sure how implementation independent it can be and still possible to
implement.

But I would like not only NM managed VPN services to register its name
subtree. Paul's libreswan is one example. What about openvpn and
wireguard? Or some weird Cisco stuff I don't know many things about?
Resolved can be configured via dbus, which is implementation independent
enough.

If resolved did not have so many bugs, it would be a nice way to have
uniform way to configure it from different services. It aspires for it.
But is not usable for me.

Does FreeBSD target also less skilled users on mobile devices?

Does it integrate somehow with Network Manager? How does it configure
forwarders?

And to add to this. In the enterprise, cloud or container universes,
split-dns is simply done by pointing all nodes to a corporate DNS
server that handles the split. There is no need for each node to be
reconfigured. So split DNS support as mentioned by Petr is another
"only on mobile devices" feature.

And that's why I find it odd that the push for systemd-resolved on the
enterprise OS is so strong, as really it is almost exclusively useful
on mobile devices.

Paul

They obivously dislike DNSSEC and consider it breaking too many stuff.
Often their first advice is try turning DNSSEC off. Worked? Okay, close
the issue.

So that shows to my point of letting them ask "what do we need to do to
be considered for a system default resolver", and one point would be
"do not disabled DNSSEC". If they keep thinking DNSSEC is not core to
the DNS protocol, they have no business being the default resolver.

Even when I disagree with them in quite many things, they have working
resolver even in weird network situations. For example routerboard wifi
routers do not support EDNS0 or DNSSEC.

EDNS is an RFC from 1999. In 2019, there was a global DNS "flag day" to
remove all workarounds dealing with badly or not implemented EDNS0:

https://kb.isc.org/docs/dns-flag-day-will-it-affect-you

It seems like systemd-resolved would be the single DNS resolver that
still feels it needs to hack around broken EDNS0 support?

If I have a laptop and connect
to such network, I would like to receive working resolution.

See the work in the ADD group. Basically, you will move anyway towards
not giving coffeeshops and hotels your DNS traffic, as that is a privacy
issue, and your system will start using a Trusted Remote Resolver (TRR).
Mozilla is already doing this for some of its users, eg in the US. That
reduces your use case to doing proper captive portal in cases of broken
DNS. And that is another battle in the opensource software stack, as
everyone and no one takes responsibility for captive portals. systemd?
NetworkManager? Gnome? Firefox? Everyone mucks a little and not enough.

That is not
as straight forward with unbound. With its default configuration it
would result in servfail and not working connectivity.

I would recommend
anyone to request such network provider to fix the DNS cache/forwarder,
but such networks are not very uncommon. If unbound should be
preinstalled also on Laptops moving from network to network, this has to
be solved somehow.

The proper engineered solution is an "upstream" container that is only
used for captive portaling and will not need DNSSEC and shouldn't need
EDNS0, that uses a contained cookieless browser (so the hotspot doesn't
get your facebook cookies) and once internet connectivity has been
enabled, you tell NM the network is up, and NM tells all the apps, and
those use their own ADD/TRR discovered DNS servers that will work with
EDNS0 and DNSSEC. Those without TRR could use DoH or DoT to well known
DNS providers (1.1.1.1, 8.8.8.8 or 9.9.9.9)

I would recommend ability to set DNSSEC validation per connection in NM.
But anyway, this should be solved automatically if unbound would be
installed on every desktop.

That should not be needed if you engineer the above suggested solution.

It works for bsd as default resolver. It has a dedicated team and budget. It’s developers attend IETF and RIPE meetings and are closely involved with operational issues and protocol development. None of this is true for systemd-resolved.

Well, Red Hat pays many of systemd developers. It is not in the same
situation as dnsmasq for example. It has its developer base not small.
But I admit they do not follow DNS best practices very often. It should
be noted that there are also other name resolution methods on Linux
workstation. It is not just DNS, but also mDNS, LLMNR or various nss
plugins. I don't know whether there is any work group working with those
methods as well.

As long as we have a few dozen open systemd-resolved bugs, I am
concluding no systemd people are working on this part of systemd.

- integration with NM manager configuring split-DNS domains properly.

We did it for libreswan, it’s trivial to add it to NM. It will have taken longer to write this email on my virtual phone keyboard. All the unbound-control commands were added for this, some specifically for this use case with libreswan at my request.

It may not be hard, but there is no existing implementation for that I
would know about. For example OpenVPN announced they would like
dbus-only configuration of those forwarders.

I'm sure unbound wouldn't mind a varlink API that can accept a wrapped
version of "unbound-control forward" commands. I think they should stay
away from the aging dbus.

Similar to dns=dnsmasq configuration in NetworkManager.conf.
- ability to pass example.corp. names validation, if they exist on
forwarders provided by local network.

Instead of all this bad hacking, those developers should get involved with the IETF ADD working group and look at the drafts produced there for exactly how future protocols are supposed to fix this. Unbound or glue code will likely be written for this by dedicated dns developers.

I have not read all ADD drafts. But do they solve how to direct name
queries to multiple resolvers when I am connected to multiple networks?

Yes. Each network can advertise the "local domains" they deem they are
authoritve for so you can reconfigure it. Note that the systemd-resolved
solution of "multiple networks" is "throw all queries to all networks",
which in a meeting with systemd people 10 years ago, I told them is an
unacceptable privacy issue. It was disgarded as not a use case they
considered.

There are attempts to solve those problems right now somehow, even
before final standard is made. Example might be hack with ~ prefix to
search domains in DHCP. Then they are just added to local domains set
for a connection, but not into /etc/resolv.conf search clause.

The mixing of search domains and DHCP domains has also been problematic,
and another case where people only look at their one use case. Red Hat
wanted to have their local domains "just work" when people connect to
their wifi, and so they cause modification of the search path, which is
a security issue. When I am at starbucks, I dont want my unqualified
queries for "mail" to go to "mail.starbucks.com". In general, my search
domains are my own, and should not be modified by the network at all.
That is, search domain for unqualified queries should not be taken from
the network ever. If you want to set it for your users, provision them
with some config/package that adds "redhat.com" to the search domains.

I am for ability to validate DNSSEC from every machine possible. However
some resolvers offered to network users do not allow it. Not only
resolved with DNSSEC=no is breaking it. If that is not important for a
network operator, okay. The user should have easy way to receive
notification this network does offer servers with working validation.
But it should work even in that case.

See above if you want to really properly engineer yourself out of this
problem. But if you are connecting to a network that does not answer
DNS queries with the DO bit set in 2022, then that network gear has not
been updated for so long, it should be considered under malicious
control, and you should REALLY not let it force you to use unprotected
DNS.

These arguments are all from individual users having one individual use
case. They are not engineering for the real world.

That’s another way of saying NM integration. And isn’t dbus legacy and the new tool is varlink? (Lack of dbus integration in general is because the low level libdbus is wrong for this and all other higher level libs pulled in a graphical desktop dependencies)

Interesting. Not sure about that. The only user of varlink that I know
is resolved. I guess any generic enough API would work. But dbus
integration on workstation would still make sense.

I had hoped varlink would have gained more steam now to replace dbus.
The libreswan team is planning to add support for it.

- no custom NSS plugin (I think this is unimportant)

This is actually a bug. Systemd-resolved changes its answer based on whether gethostbyname() or getaddr_info() is used. One of the reasons I remove this from nsswitch.conf in all my systems.

Not sure what do you mean. Can you explain?

If you change resolv.conf to a real server instead of 127.0.0.53, and
leave "resolv" in nsswitch.conf, then glibc will still intercept
gethostbyname() calls and use systemd-resolved to resolve those. While
getaddr_info() complies to POSIX still and MUST use the nameserver in
/etc/resolv.conf, so glibc honours that. You get a frankenresolver based
on what lowlevel DNS calls apps or libraries are using.

I would like to move LLMNR and mDNS resolution to nss plugins only. But
there is no simple to use asynchronous API, which can request names
including nss plugins from application. If we insist on DNS, we end in
the same mess resolved now has. We have getdns library, which is nice.
But DNS specific. I think we miss a simple library or service, which can
provide getaddrinfo() library calls in non-blocking way and easily
integrated into desktop application.

Maybe others know more about this and can point you somewhere.

Resolved has dbus resolve1 API [3], which seems too specific for
resolved. I don't like the API itself, but provides a way to
asynchronously resolve address without extra pain.

I am amused at the sentence containing "dbus" and "without extra pain".
I tried using the various example codes and none of it worked when I
was playing with it.

Very very few people need mdns or LLMNR, especially on servers or containers. I like my enterprise DNS not optimizing for printer discovery or a developers need to reach a fake .box TLD to login to their router.

I understand servers rarely need LLMNR. It breaks too many things in
current systemd-resolved implementation. Filled [1] recently, but I
doubt they would change it enough.

Thanks for filing that. It is indeed yet another bug where the RFC is
not followed, and things break :frowning:

Anyway, if I configure root forwarders to some local server and it can

another nice feature of unbound is support for local root, RFC 8806.
Which also prevents a lot of junk queries from leaking on the internet
and increases privacy for the users on typos not leaking to root servers
via ISP.

respond to 'machine.example.' query with unsigned content, it is quite
lame if my unbound turns that response to NXDOMAIN, because example. is
proven non-existent at root. That server obviously knows it. If that
domain is immediately above root, there is no danger just accepting this
with NTA exception IMO. Many existing networks misuse some kind of
private TLD. If we want unbound with DNSSEC enabled to be a default, it
should not break on every such network, where it worked for years
before. Of course they should be told to get and use own domain. There
is not a small collection, which might be accepted by default [2].

That is something that can again be easilly provisioned using an
enterprise package (or home user config) that adds such domains to an
unbound include file in /etc/unbound.d/ which is why I created that
directory in the fedora unbound package to allow files to be dropped in
there without needing to change the core /etc/unbound/unbound.conf.

Well, something can be changed via Merge Requests to systemd. But they
have own ideas how it is correct.

Based on my commets and RFC quoting in their github issue tracker, I
wouldn't invest my time in fixing code to only see it rejected as not
their use case. Sorry :frowning:

My efforts can change something. But fact is systemd team has more
developers and I am alone again in our Infrastructure Services team on
DNS related products for RHEL.

That mirrors my situation there, except that I had the weight of a DNS
RFC author as well, and still that did not help :frowning:

In fact systemd maintainer asked me for a
requirements summary on modern system. Any idea for a good mailing list
for that question? Or working group? Except what we already discussed, I
think easy registration of local hostnames would be useful. As a
replacement for libvirt-nss plugin, which provides names only via
getaddrinfo calls. Unless I have something equivalent or better than
systemd-resolved, I am afraid the resolution implementation in next
major RHEL release would become resolved.

As long as systemd-resolved remains split of in its own package we can
rpm -e, I can live with that. For most users, the browser's DNS is what
really matters, and there firefox is going full TRR anyway, so whatever
the OS will do in the future will not really matter anymore.

Paul

They obivously dislike DNSSEC and consider it breaking too many stuff.
Often their first advice is try turning DNSSEC off. Worked? Okay, close
the issue.

So that shows to my point of letting them ask "what do we need to do to
be considered for a system default resolver", and one point would be
"do not disabled DNSSEC". If they keep thinking DNSSEC is not core to
the DNS protocol, they have no business being the default resolver.

I agree. But they have well integrated implementation, which solves
*some* users' problems. Of course it breaks others, but that is a
different story.

Even when I disagree with them in quite many things, they have working
resolver even in weird network situations. For example routerboard wifi
routers do not support EDNS0 or DNSSEC.

EDNS is an RFC from 1999. In 2019, there was a global DNS "flag day" to
remove all workarounds dealing with badly or not implemented EDNS0:

https://kb.isc.org/docs/dns-flag-day-will-it-affect-you

It seems like systemd-resolved would be the single DNS resolver that
still feels it needs to hack around broken EDNS0 support?

This is not only case of systemd-resolved. They have ticket with broken
DBahn train network. I were talking about mikrotik system, which
provides not bad routers with updated firmware [1]. They have many good
features, even have DNS over TLS support. I have made a ticket, but
unless there is a demand for DNSSEC support from customers, they won't
fix that.

So resolvers without DNSSEC or even EDNS0 exists. We should not create
hacks for their invalid responses. But if they ignore ENDS0 or DNSSEC OK
bit, that is well specified. We have to allow that working somehow, if
DNSSEC validation should become enabled by default. It might emit
warning in status icon or something like, but should connect and
resolve. I would consider that well-implemented DNSSEC=allow-downgrade,
which resolved has just wrong.

If I have a laptop and connect
to such network, I would like to receive working resolution.

See the work in the ADD group. Basically, you will move anyway towards
not giving coffeeshops and hotels your DNS traffic, as that is a privacy
issue, and your system will start using a Trusted Remote Resolver (TRR).
Mozilla is already doing this for some of its users, eg in the US. That
reduces your use case to doing proper captive portal in cases of broken
DNS. And that is another battle in the opensource software stack, as
everyone and no one takes responsibility for captive portals. systemd?
NetworkManager? Gnome? Firefox? Everyone mucks a little and not enough.

That is not
as straight forward with unbound. With its default configuration it
would result in servfail and not working connectivity.

I would recommend
anyone to request such network provider to fix the DNS cache/forwarder,
but such networks are not very uncommon. If unbound should be
preinstalled also on Laptops moving from network to network, this has to
be solved somehow.

The proper engineered solution is an "upstream" container that is only
used for captive portaling and will not need DNSSEC and shouldn't need
EDNS0, that uses a contained cookieless browser (so the hotspot doesn't
get your facebook cookies) and once internet connectivity has been
enabled, you tell NM the network is up, and NM tells all the apps, and
those use their own ADD/TRR discovered DNS servers that will work with
EDNS0 and DNSSEC. Those without TRR could use DoH or DoT to well known
DNS providers (1.1.1.1, 8.8.8.8 or 9.9.9.9)

It is not so simple. There might be some local services, which you want
still reachable. For example local network printer, hotel reception page
or train page with services menu. But I found in recent RFC 8801 [2]
reference to aging RFC 6731 [3]. Both should be implemented in NM. Then
they could provide list of local resources domains for each connection
to unbound.

I think the containerized solution can be archieved by setting max TTL
to 1 until dashboard passes. Once it passes dashboard login, it can
remove restriction to max TTL and continue just well.

But right, spawning another cache configured for just tested forwarders
would be more clean. Then a browser directed to use that NS would
process the dashboard. But wait, it can be directed then to the tested
NS instead, without immediate cache, right?

I think it would not be bad, if you could assign some tag to selected
forwarders. Then when you would remove forwarders with that tag, a
simple action could clear all cached resources obtained from those
forwarders. Would be useful for clearing hosts when you disconnect from
LAN or VPN and those hosts start to be unreachable, because they are
working only on that connection. RFC 8801 mentions such case.

I would recommend ability to set DNSSEC validation per connection in NM.
But anyway, this should be solved automatically if unbound would be
installed on every desktop.

That should not be needed if you engineer the above suggested solution.

This seems like well integrated dnssec-trigger. I would like it
possible, but that is another level. Basic level would be working
connection over servers the network offered. It might be mandatory in
some organizations. For example in redhat network dns queries are
monitored for communication with botnets or such potential threats. I
want maximal possible security which the network I use can provide.

Using alternative servers is out of scope for that.

It works for bsd as default resolver. It has a dedicated team and
budget. It’s developers attend IETF and RIPE meetings and are
closely involved with operational issues and protocol development.
None of this is true for systemd-resolved.

Well, Red Hat pays many of systemd developers. It is not in the same
situation as dnsmasq for example. It has its developer base not small.
But I admit they do not follow DNS best practices very often. It should
be noted that there are also other name resolution methods on Linux
workstation. It is not just DNS, but also mDNS, LLMNR or various nss
plugins. I don't know whether there is any work group working with those
methods as well.

As long as we have a few dozen open systemd-resolved bugs, I am
concluding no systemd people are working on this part of systemd.

That depends on how important those bugs are considered by them. Some
issues are fixed overnight. Some are open for years.It may not be hard,
but there is no existing implementation for that I

would know about. For example OpenVPN announced they would like
dbus-only configuration of those forwarders.

I'm sure unbound wouldn't mind a varlink API that can accept a wrapped
version of "unbound-control forward" commands. I think they should stay
away from the aging dbus.

Okay, good note. Whatever is usable by third party is acceptable.

I have not read all ADD drafts. But do they solve how to direct name
queries to multiple resolvers when I am connected to multiple networks?

Yes. Each network can advertise the "local domains" they deem they are
authoritve for so you can reconfigure it. Note that the systemd-resolved
solution of "multiple networks" is "throw all queries to all networks",
which in a meeting with systemd people 10 years ago, I told them is an
unacceptable privacy issue. It was disgarded as not a use case they
considered.

I think they have changed that crazy idea already. I know you had mostly
conflicts with them, but they are getting slightly better. But something
like this is mentioned in RFC 6731. If multiple connections provide the
same name, you should ask all servers with equivalent priority. I don't
think this is possible with normal DNS resolver, because it considers
the first NXDOMAIN as a final answer.

There are attempts to solve those problems right now somehow, even
before final standard is made. Example might be hack with ~ prefix to
search domains in DHCP. Then they are just added to local domains set
for a connection, but not into /etc/resolv.conf search clause.

The mixing of search domains and DHCP domains has also been problematic,
and another case where people only look at their one use case. Red Hat
wanted to have their local domains "just work" when people connect to
their wifi, and so they cause modification of the search path, which is
a security issue. When I am at starbucks, I dont want my unqualified
queries for "mail" to go to "mail.starbucks.com". In general, my search
domains are my own, and should not be modified by the network at all.
That is, search domain for unqualified queries should not be taken from
the network ever. If you want to set it for your users, provision them
with some config/package that adds "redhat.com" to the search domains.

Here I think it should be possible to ignore local domains. Whether they
are provide by RDNSS or search, user should be able to override them or
ignore them all. That would be important for NM feature.

If you don't want mail to reach starbucks.com, just use full name in
their network. But I would like to use ping router at home or at work,
if those hosts have the same name. When search is used on trusted
connection, I think that is okay. Again, this should be configurable per
connection in NM.

I think search domain were used, because it were possible to already
configure it in existing software. It is visible in NM and DHCP. It also
make sense to have it set in most cases. RFC 6731 would be better, but
that is not yet implemented on Fedora AFAIK.

I am for ability to validate DNSSEC from every machine possible. However
some resolvers offered to network users do not allow it. Not only
resolved with DNSSEC=no is breaking it. If that is not important for a
network operator, okay. The user should have easy way to receive
notification this network does offer servers with working validation.
But it should work even in that case.

See above if you want to really properly engineer yourself out of this
problem. But if you are connecting to a network that does not answer
DNS queries with the DO bit set in 2022, then that network gear has not
been updated for so long, it should be considered under malicious
control, and you should REALLY not let it force you to use unprotected
DNS.

Unfortunately that is not correct. Even one of our internal RH resolvers
has it disabled for a discutable reason. And Mikrotik's latest system
still does not support even EDNS. I expect more similar vendors exist. I
think it should be visible to user that this network has some issues,
but it should not prevent working connection.

These arguments are all from individual users having one individual use
case. They are not engineering for the real world.

I know multiple cases when this happens. Denying them would not lead to
better alternative to systemd-resolved.

Interesting. Not sure about that. The only user of varlink that I know
is resolved. I guess any generic enough API would work. But dbus
integration on workstation would still make sense.

I had hoped varlink would have gained more steam now to replace dbus.
The libreswan team is planning to add support for it.

Thanks for the infromation. I would have to look at what it is and how
does it work. Never seen a code for working with that.

This is actually a bug. Systemd-resolved changes its answer based on
whether gethostbyname() or getaddr_info() is used. One of the
reasons I remove this from nsswitch.conf in all my systems.

Not sure what do you mean. Can you explain?

If you change resolv.conf to a real server instead of 127.0.0.53, and
leave "resolv" in nsswitch.conf, then glibc will still intercept
gethostbyname() calls and use systemd-resolved to resolve those. While
getaddr_info() complies to POSIX still and MUST use the nameserver in
/etc/resolv.conf, so glibc honours that. You get a frankenresolver based
on what lowlevel DNS calls apps or libraries are using.

No, that is not true. Both gethostbyname() and getaddrinfo() use
nsswitch on Linux (or BSD), libnss_dns.so. That can provide addresses
even before ANY dns server is contacted. One possibility is /etc/hosts,
another might be mdns or libvirt plugin.

Sure, that can lead to a situation, where getent hosts localhost gets
and address, but dig localhost doesn't. Minor advantage of resolve
plugin is it can cache also /etc/hosts. And make faster lookup from it.
Pure DNS resolver usually ignores that file. dnsmasq reads that file
also. I think additional plugin monitoring that file and filling local
data from it would help also with unbound on workstations. What do you
think?

I would like to move LLMNR and mDNS resolution to nss plugins only. But
there is no simple to use asynchronous API, which can request names
including nss plugins from application. If we insist on DNS, we end in
the same mess resolved now has. We have getdns library, which is nice.
But DNS specific. I think we miss a simple library or service, which can
provide getaddrinfo() library calls in non-blocking way and easily
integrated into desktop application.

Maybe others know more about this and can point you somewhere.

Resolved has dbus resolve1 API [3], which seems too specific for
resolved. I don't like the API itself, but provides a way to
asynchronously resolve address without extra pain.

I am amused at the sentence containing "dbus" and "without extra pain".
I tried using the various example codes and none of it worked when I
was playing with it.

I mean desktop people might already know how to work with d-bus well.
For them that should be easy. It is not easy for me. But the thing is,
you have to implement some thread stuff, waiting for blocking
getaddrinfo() then send event somewhere to eventloop.

I think it should be simple to have single thread and eventloop, where I
say connect to "example.org" and tell me when the socket is ready or
when that failed. I have found nice QHostInfo class [4] for Qt, but I
doubt there is something similar for GTK. I think even console
applications using glib might need it asynchronous from time to time.
Not sure how well is getaddrinfo_a supported, but it is only for Linux.
Not for *BSD.

Very very few people need mdns or LLMNR, especially on servers or
containers. I like my enterprise DNS not optimizing for printer
discovery or a developers need to reach a fake .box TLD to login to
their router.

I understand servers rarely need LLMNR. It breaks too many things in
current systemd-resolved implementation. Filled [1] recently, but I
doubt they would change it enough.

Thanks for filing that. It is indeed yet another bug where the RFC is
not followed, and things break :frowning:

I am not sure, LLMNR RFC might be followed in fact. But it seems even
Microsoft does not follow that and restricts it just to few types.

Anyway, if I configure root forwarders to some local server and it can

another nice feature of unbound is support for local root, RFC 8806.
Which also prevents a lot of junk queries from leaking on the internet
and increases privacy for the users on typos not leaking to root servers
via ISP.

Sometimes you need to reach local resources via local forwarder. For
example tplinkmodem.net name is used to configure some tplink routers.
Once we have way to specify just few local resources on a network, okay.
But until that we need local name override by on connection configuration.

respond to 'machine.example.' query with unsigned content, it is quite
lame if my unbound turns that response to NXDOMAIN, because example. is
proven non-existent at root. That server obviously knows it. If that
domain is immediately above root, there is no danger just accepting this
with NTA exception IMO. Many existing networks misuse some kind of
private TLD. If we want unbound with DNSSEC enabled to be a default, it
should not break on every such network, where it worked for years
before. Of course they should be told to get and use own domain. There
is not a small collection, which might be accepted by default [2].

That is something that can again be easilly provisioned using an
enterprise package (or home user config) that adds such domains to an
unbound include file in /etc/unbound.d/ which is why I created that
directory in the fedora unbound package to allow files to be dropped in
there without needing to change the core /etc/unbound/unbound.conf.

It doesn't work that way if you have mobile device. When I am at work, I
want only local resources. At home I want them different. There has to
be way for network to provide them. RFC 8801 seems able to provide even
TLS protected network identification. Until that is common, I think
per-connection override would work. But I don't want it hardcoded in a
single system.

Well, something can be changed via Merge Requests to systemd. But they
have own ideas how it is correct.

Based on my commets and RFC quoting in their github issue tracker, I
wouldn't invest my time in fixing code to only see it rejected as not
their use case. Sorry :frowning:

Understood. That is why I started here. I would like to improve other
products more than to write flames with Lennart.

My efforts can change something. But fact is systemd team has more
developers and I am alone again in our Infrastructure Services team on
DNS related products for RHEL.

That mirrors my situation there, except that I had the weight of a DNS
RFC author as well, and still that did not help :frowning:

In fact systemd maintainer asked me for a
requirements summary on modern system. Any idea for a good mailing list
for that question? Or working group? Except what we already discussed, I
think easy registration of local hostnames would be useful. As a
replacement for libvirt-nss plugin, which provides names only via
getaddrinfo calls. Unless I have something equivalent or better than
systemd-resolved, I am afraid the resolution implementation in next
major RHEL release would become resolved.

As long as systemd-resolved remains split of in its own package we can
rpm -e, I can live with that. For most users, the browser's DNS is what
really matters, and there firefox is going full TRR anyway, so whatever
the OS will do in the future will not really matter anymore.

Paul

I think TRR belongs not to the browser, but to the system. I want to be
protected by GDPR in EU anyway. Unbound can use DNS over TLS even
without stubby. That is great. But local resources have to be solved
somehow. Application specific DNS resolver will never be able to fulfill
that IMO. How to make it configurable also by non-experts, that is a
different task.

I would like to propose more DNSSEC features. I like SSHFP for example.
But that requires user-friendly validator. dnssec-trigger is quite
annoying, when your connection breaks for some reason. I hope secure
enough DNS will become possible on every system.

Btw. original NM unbound plugin, which called dnssec-trigger, were
removed recently from NM [5]. Time to start a real one?

Cheers,
Petr

1. https://mikrotik.com/products/group/wireless-for-home-and-office
2. https://www.rfc-editor.org/rfc/rfc8801.html
3. https://www.rfc-editor.org/rfc/rfc6731.html
4. https://doc.qt.io/archives/qt-4.8/qhostinfo.html
5.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/5da17c689be5e66ea2f63dea6f1846625e652998

Well, I am not sure how it is in different companies. But in Red Hat
engineering we receive almost exclusively mobile devices (laptops) to
work on. I expect it is similar elsewhere. When looking at RFC 8801,
people working on it are from Google, Apple and Cisco. I think even
mobile phones have similar requirements.

Of course, static workstation which never moves is simple to configure
right. I know mobile devices with multiple interfaces are more difficult
to handle well. But if we handle them, the rest should just work.

Petr