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