Not sure if this will be helpful for any future people, found this post while doing my own troubleshooting when this came up.
Was just having this issue on my server "randomly", did all my typical reboots, trying different DNS servers (Google, OpenDNS, Cloudflaare, etc) to no avail.... was going through my mind and thinking of stuff that's changed recently and I use a PfSense firewall and had installed "Avahi" package recently to allow one network (hardwire) to Chromecast to my other network (WiFi) and haven't noticed any issues since installing it... until I logged into my server, a few weeks later.. of course.
After removing the package and turning DNS to "manual" then back to "auto" seems to resolve it. (can also change it back to manual and works fine)