And the solution should be to edit /etc/systemd/resolved.conf by changing #DNSStubListener=yes to DNSStubListener=no according to this post I found. But the /etc/systemd/resolved.conf doesn't exist on my server.
I've tried sudo dnf install /etc/systemd/resolved.conf which did nothing other than telling me that systemd-resolved is already installed of course. Rebooting also didn't work. I don't know what else I could try.
I'm running Fedora Server.
Is there another way to stop systemd-resolved from listening on port 53? If not how do I fix my missing .conf file?
Um, dnf doesn't do anything with configuration files. It is used for packages.
I would start by trying to create that file. If that doesn't fix it after restarting the service look into the docs. You may need to configure network manager.