Make n8n and/or Docker Use Local DNS Cache

Hi,

We occasionally have DNS timeout errors in workflows that make 10,000’s of API requests. The “retry on error” node option helps but not completely.

I noticed lots of repetitive DNS queries for the same API hostname coming from the system where n8n is running. So I was wondering if there’s a way to set it to cache DNS resolutions so that one successful response is all that’s needed.

Thanks!

Information on your n8n setup

  • n8n version:
  • 1.95.3
  • Database (default: SQLite):
  • Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • default
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Docker
  • Operating system:
  • Ubuntu 24.04.2 LTS

Hey @jzrts hope all is good.

What I think you could do is set an additional container running a dns caching server and point your n8n container to that server for dns requests.