[Bug 2062927] Re: Ambiguity in mdns configuration
Hadmut Danisch
2062927 at bugs.launchpad.net
Thu May 9 09:23:15 UTC 2024
Well, the problems I had happened about 1.5 years ago with Ubuntu 22.04
and a Huawei fiber router with DHCP, but without local DNS zone, and I
recall all details, just the fact that only Ubuntu machines had
problems, while other Linux-based machines didn't, and after several
days of working I just gave up and bought an OpenWRT router to put
between just to get Ubuntu machines running.
As far as I remember the main problem was, that I usually put my clients and services in LXD, docker and podman containers, and I was not able to get mdns running within these containers since they do not receive those mdns packages. I found no way to redistribute them into all containers, and one of the problem is that the containers do have IP addresses from different ranges.
Another problem was that container machines like LXD and docker enforce
to either forward DNS requests to either 127.0.0.53:53 (=resolved) or
the router (=Huawei fiber), but there is no DNS service to forward mDNS
requests to.
I got some success by not telling the machines in the container anything
at all about mdns, just let them forward all requests, including to the
.local. domain, to the container mechanism, i.e. to resolved runnin g on
the host. This works for querying, but is highly unreliable. Sometimes
it took more than 10 Minutes to finally resolve a machine. resolved's
mdns implementation seems somewhat broken and to suffer from some bugs.
The other problem is that resolved does not advertise anything other
than its own host name.
So this runs into two contradicting requirements:
1. To resolve mdns queries from within a container, you need to ignore
mdns inside the container and let the container environment do the job,
i.e. forward to resolved (which mdns settings enabled).
2. To advertise services or virtual machines (such as the containers),
you need avahi, because resolved can't. Resolved just performs very
simple client tasks, even those unreliably.
But not both resolved and avahid can have the mdns, and you can't tell resolved to use mdns, but not to occupy the port.
I do remember that I had used mdns with Ubuntu around 2007, and it was working perfectly then.
Now the problem seems to be, that on one hand systemd+resolved is enforced and so deeply implanted, that you can't avoid it and container environments like LXD, docker enforce to forward DNS queries from within the container to the hosts's resolved, but resolved's implementation is incomplete and broken.
Actual example: I usually have a virtual machine running on LXD called
"install", which offers services like a puppet server, docker cache,
debian/ubuntu cache, gem server. I'm using this method for years. But I
simply was not able to get this running and to install LXD containers on
other machines in a network managed by this Huawei router with DHCP, but
without a DNS zone reflecting DHCP assignments. I would have had to
assign all IP addresses statically and enter them in to /etc/hosts.
I ended up with buying an additional router with proper DNS, just to get
the Ubuntu machines up and running, since the cannot properly deal with
mdns.
I had hoped that things were getting better with 24.04, but there seems to be no difference.
There is simply no plan about how mdns should work on Ubuntu. resolved
doesn't work properly, but you can't get rid of resolved, and can't have
both, resolved and avahi, either.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2062927
Title:
Ambiguity in mdns configuration
Status in avahi package in Ubuntu:
Confirmed
Status in systemd package in Ubuntu:
Confirmed
Bug description:
Hi,
I recently failed to get a 22.04 and 23.04 running reliably in a
network with a cheap Huawei fiber router which provides routing and
DHCP, but does not offer a DNS service with a zone with DHCP hosts.
Therefore, machines cannot find each other by DNS.
Since mdns is designed to solve this problem (and I could remember
that Ubuntu was dealing with such networks properly about 10 years
ago), I tried to configure the machines to use mdns.
I was not able to get things running, since there are collisions
between systemd/resolved on one hand, and avahi daemon on the other,
colliding both on the UDP port and the functionality.
systemd/resolved are not really able to provide all services, but it
is not possible to use avahi only either, since systemd/resolved is
built so deeply into ubuntu, that it can't be removed or turned off
without breaking lots of functionalities. Furthermore, I found systemd
to be unreliable as an mdns resolver. Sometimes it works, sometimes it
doesn't, sometimes it takes minutes.
I would have expected that Ubuntu would drop avahi daemon after moving
to systemd, but now I found that 24.04 still comes with avahi daemon
and competing functionalities.
E.g. avahi suggests to install libnss-mdns, while resolved wants mdns
to be enabled in /etc/systemd/resolved.conf and to handle it itself.
So what is the suggested way to use Ubuntu in a network without proper
DNS for DHCP-clients?
systemd+resolved? avahi? both?
I did not find any documentation about this, no simple configuration
settings, no answer to the question how mdns should be used on Ubuntu
since Ubuntu moved to systemd.
Nobody seems to care.
regards
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/avahi/+bug/2062927/+subscriptions
More information about the foundations-bugs
mailing list