When the configured DNS server (e.g. that taken from resolv.conf) cannot be reached, Prosody does not correctly fall through to the next DNS server.
This can be reproduced by running: sudo ip route add blackhole 220.127.116.11/32
(assuming 18.104.22.168 is your configured DNS server IP).
Fixed in f869eec511c8, 84ca02c6a47e, 4a28b8320d7f, and 7cb69eba3e95.