Basically, you're hard coding what ip address needs to be accessed when your server wants to talk to www.googleapis.com instead of relying on a DNS server to give it that information. Effectively, we're bypassing the DNS solutions that were offered for previous fixes in this thread. It's not a perfect fix because the IP addresses may change in the future and your server would have no way of knowing unless you manually change the hosts file again or remove those lines so it starts resorting to DNS lookups again.
On Hetzner root server located in Falkenstein, running Debian 11 and swizzin set up. Just became aware of this issue since I saw my drive was filling up cause files weren't uploading.
So I did add the IP to /etc/hosts . Is this in addition to the DNS changes? Haven't done those, cause I can't find some of those config files to make the changes in. Guess Debian 11 on Hetzner has them stored somewhere else.
Debian 11 I only changed the DNS in /etc/resolv.conf and worked for me. Did you try to update that one?