I've got a temporary situation where I'm working with pre-release F27, and need to keep one package to a specific (working) version and not be upgraded until the subsequent versions stop breaking something. I know in general "you don't really want to do this", but as I said, it's a temporary dealing with a pre-rel system. You can "pin" packages with the apt system, but I can't locate anything equivalent for dnf.
excludepkgs configuration option in
dnf.conf lists packages that
dnf should never try to install or upgrade; in a repo section it affects only that repo, in
[main] all repos are affected. See the
dnf.conf(5) man page for details.