"The DNS server returned an error, perhaps the server is offline."

I am not quite sure why this changed things…

But thru many hours of testing and investigation. I finally fixed this. Simply adding:

network_mode: bridge to the n8n container in your docker compose fixes this issue.
I don’t fully understand why, but the bug seems to be related to a bug that exists all the way back in 2016: dns configuration option does not work on docker-compose==1.6.0 · Issue #2847 · docker/compose · GitHub.

Despite network mode bridge being default when no mode is attached.

All my DNS settings were correct on host, and within docker compose otherwise.

For refernce:
Docker compose: v2.29.2
Dockerd/docker: 27.2.0, build 3ab4256

3 Likes