... and after other 7 years, some considerations by me with the hat of new
maintainer for NIS packages.
First of all, the bullseye package is now split in nis-client (ypbind-mt) and
nis-server (ypserv). Both them use the usual /etc/defaultdomain as
taken from Sun convention for Solaris boxes. Basically, any dynamic setup
just needs to set that file appropriately, before running the right services.
I guess the required dyanamic capability is requested for clients, in order
to load ypbind-mt only on request, with the required setup. I think that a
dynamic setup is a non₋sense for servers.
Even in the case of multiple NIS domains, it is always possible to set domain
and NIS servers in advance in /etc/yp.conf statically. Then, it is also
possible to add Wants/After to ypbind.service on
systemd-networkd-wait-online.service after enabling it. This should be totally
optional in order to start the ypbind service only after one network goes up.
That does not solve the issue of recognizing the host network, of course.
Even in case of broadcasting, you need an oracle to know the domain and bind
to it. One way to do that is of course having the nis-domain and nis-servers
set at dhcp server level.
In bullseye, systemd version is able to wait any of a specific pool of
interfaces before binding (that is not possibile in buster: you need to choose
a single interface and wait on that), therefore IFF the dhcp server is able
to provide the required nis-* vars, one can set the /etc/defaultdomain just
before running ypbind. In the other case, the system could use the existing
file, as plan B. The problem is that in general you would not do that if
the host network is the wrong one: running ypbind when not expected is not
nice for timeouts.
IMHO this kind of setup is complex enough and dependent on quite enough
implementations and use cases to avoid installing any dhcp snippet per
default, and leave the whole beast as a possible solution (with variants) in
the doc section, including manipulation of /etc/nsswitch.conf, changes to
systemd services, etc.
Anyone there, still interested to comment?