DNS error in n8n 2.12.2 on VPS (IPv4 forced, still failing)

Describe the problem/error/question

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

I’m running n8n on my own VPS (Contabo) and I’m getting a DNS-related error when executing workflows that require external network access.

The issue persists even after configuring DNS and forcing IPv4 usage.

What is the error message (if any)?

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

What I already tried

DNS configuration on server

I manually configured DNS on the server:

DNS=1.1.1.1 1.0.0.1
FallbackDNS=8.8.8.8 8.8.4.4
  • Restarted the server after applying changes
  • Verified DNS resolution works from terminal (dig google.com works fine)

Forcing IPv4 in Node.js / n8n

I added the following environment variables:

NODEJS_PREFER_IPV4=true
NODE_FUNCTION_ALLOW_BUILTIN=*
NODE_OPTIONS=--dns-result-order=ipv4first

Additional context

  • The error happens in any node that performs HTTP requests (e.g., HTTP Request node)
  • It doesn’t seem related to a specific workflow
  • The server itself can resolve domains correctly, but n8n fails

Please share your workflow

The issue is not workflow-specific. It happens with any simple HTTP request.

Share the output returned by the last node

The node fails with the DNS error mentioned above.

Information on your n8n setup

  • n8n version: 2.12.2
  • Database: Default (SQLite)
  • n8n EXECUTIONS_PROCESS setting: Default
  • Running n8n via: (Docker / EasyPanel — specify if needed)
  • Operating system: Linux (Contabo VPS)

hey, this is most likely a Docker networking issue rather than n8n itself. Even though the host resolves DNS fine, the n8n Docker container uses Docker’s internal DNS by default and won’t inherit the host’s /etc/resolv.conf changes. Try adding dns settings directly to your docker-compose.yml under the n8n service: dns: ['1.1.1.1', '8.8.8.8']. The NODE_OPTIONS env var is worth keeping but the container-level DNS config is usually the root cause here.

Hi @dark_note

I’d test DNS directly inside the n8n container nslookup/curl. If it fails there, I’d suspect container networking. I’d also check IPv6, especially on Contabo.