External Publication
Visit Post

N8n on Hugging Face Space: getaddrinfo ENOTFOUND api.telegram.org Connection Error

Hugging Face Forums [Unofficial] February 7, 2026
Source

I found workaround for this. Use Google DNS 8.8.8.8 instead..

I set it up on Dockerfile (I am free tier), if you are pro then it might be easier for you.

For whoever hosted n8n on hf space, you need to use multi-stage build.

#STEP 1: Borrow tools from a standard Alpine image since n8n doesn’t have it. FROM alpine:latest AS tool-provider RUN apk add --no-cache su-exec

#STEP 2: Build the final n8n image FROM docker.n8n.io/n8nio/n8n:latest USER root

#Create the entrypoint script RUN printf ‘#!/bin/sh\n echo “nameserver 8.8.8.8” > /etc/resolv.conf\n echo “nameserver 8.8.4.4” >> /etc/resolv.conf\n echo “DNS successfully set to 8.8.8.8”\n exec su-exec node n8n start\n’ > /docker-entrypoint.sh && chmod +x /docker-entrypoint.sh

[whatever you have in put it here. ie. ENV, custom run script, etc.] ENV N8N_PROXY_HOPS=1 #To avoid ValidationError: The ‘X-Forwarded-For’ header is set but the Express ‘trust proxy’ setting is false (default).

#Final switch to root for the entrypoint USER root ENTRYPOINT [“/bin/sh”, “/docker-entrypoint.sh”]

On container runtime log, you should see “DNS successfully set to 8.8.8.8” as it successfully started n8n and use google dns

Tested with discord worked.

Discussion in the ATmosphere

Loading comments...