We have an issue when trying to use Traefik for auto certificate issuing.
Error Message
unable to generate a certificate for the domains [portainer.corp.eastx.com]: error: one or more domains had a problem:
[app.sub.domain.com] [app.sub.domain.com] acme: error presenting token: cloudflare: could not find zone for domain \"app.sub.domain.com\": [fqdn=_acme-challenge.app.sub.domain.com.] could not find the start of authority for '_acme-challenge.app.sub.domain.com.': DNS call error: read udp 172.20.0.6:39658->1.1.1.1:53: i/o timeout [ns=1.1.1.1:53, question='com. IN SOA']
DNS call error: read udp 172.20.0.6:60551->1.0.0.1:53: i/o timeout [ns=1.0.0.1:53, question='com. IN SOA']
Compose for Reference
traefik:
container_name: traefik
image: proget.sub.domain.com/docker-hub/traefik:latest
ports:
- 80:80
- 443:443
- 8080:8080
networks:
- default
restart: unless-stopped
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.http.address=:80"
- "--entryPoints.http.http.redirections.entryPoint.to=https"
- "--entryPoints.http.http.redirections.entryPoint.scheme=https"
- "--entrypoints.http.http.redirections.entrypoint.priority=10"
- "--entrypoints.https.address=:443"
- "--serversTransport.insecureSkipVerify=true"
- "--certificatesresolvers.cloudflare.acme.dnschallenge=true"
- "--certificatesresolvers.cloudflare.acme.dnschallenge.provider=cloudflare"
- "--certificatesresolvers.cloudflare.acme.dnschallenge.resolvers=1.1.1.1:53,1.0.0.1:53"
- "--certificatesresolvers.cloudflare.acme.storage=/etc/certs/acme.json"
- "--certificatesresolvers.cloudflare.acme.email=${CLOUDFLARE_EMAIL}"
- "--certificatesresolvers.cloudflare.acme.caServer=https://acme-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.cloudflare.acme.keytype=EC256"
environment:
- CLOUDFLARE_DNS_API_TOKEN=${CLOUDFLARE_API_TOKEN}
- HTTP_PROXY=http://proxy.sub2.domain2.co:3128
- HTTPS_PROXY=http://proxy.sub2.domain2.co:3128
- NO_PROXY=127.0.0.1,localhost,.sub.domain.com,.domain2.co,.amazonaws.com,169.254.169.254,${CORE_SUBNET}
volumes:
- ./traefik:/etc/traefik/dynamic/
- ./certs:/etc/certs/
- /var/run/docker.sock:/var/run/docker.sock:ro
The Problem
The server is sat behind a corporate proxy (squid) and outbound access is restricted but the correct domains/ IPs have been allowed for this process. The corporate proxy only supports TCP traffic - the error read udp 172.0.0.06:39658->1.1.1.1:53: i/o timeout
suggests that the DNS lookup is failing over UDP which is expected as the proxy would not allow this.
Is there anyway to force the DNS lookup to happen over TCP?