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 188.8.131.52/32
(assuming 184.108.40.206 is your configured DNS server IP).
Fixed in f869eec511c8, 84ca02c6a47e, 4a28b8320d7f, and 7cb69eba3e95.