So I'm actually playing around with reverse proxying so nothing is crucial here. I have a DNS server configured to answer requests on port 53. My DNS server is technitium. Both my DNS server and traefik are running through docker.
In a nutshell, the DNS requests are working using the "q" client like this:
$ q archtm.example.com @TCP://ns1.example.com
archtm.example.com. 1h A 10.0.1.107
However I'm receiving a bunch of errors in the traefik logs similar to what's below. To help decipher some of the ip addresses in the file I have the following IPs:
-- Testing "q" client sending out dns requests: 10.8.110.1
-- Docker traefik container: IPAddress": "172.19.0.3"
-- Docker dns-server container: IPAddress": "172.19.0.2"
Error log:
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/middlewares/tcp/ipallowlist/ip_allowlist.go:60 > Connection from 10.8.110.1:61313 accepted middlewareName=ipallowlist@file middlewareType=IPAllowListerTCP
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/tcp/proxy.go:41 > Handling TCP connection address=dns-server:53 remoteAddr=10.8.110.1:61313
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/tcp/proxy.go:113 > Error while setting TCP connection deadline error="set tcp 172.19.0.3:53: use of closed network connection"
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/middlewares/tcp/ipallowlist/ip_allowlist.go:60 > Connection from 10.8.110.1:49240 accepted middlewareName=ipallowlist@file middlewareType=IPAllowListerTCP
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/tcp/proxy.go:41 > Handling TCP connection address=dns-server:53 remoteAddr=10.8.110.1:49240
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/tcp/proxy.go:113 > Error while setting TCP connection deadline error="set tcp 172.19.0.3:53: use of closed network connection"
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/middlewares/tcp/ipallowlist/ip_allowlist.go:60 > Connection from 10.8.110.1:37033 accepted middlewareName=ipallowlist@file middlewareType=IPAllowListerTCP
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/tcp/proxy.go:41 > Handling TCP connection address=dns-server:53 remoteAddr=10.8.110.1:37033
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/tcp/proxy.go:113 > Error while setting TCP connection deadline error="set tcp 172.19.0.3:53: use of closed network connection"
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/middlewares/tcp/ipallowlist/ip_allowlist.go:60 > Connection from 10.8.110.1:47187 accepted middlewareName=ipallowlist@file middlewareType=IPAllowListerTCP
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/tcp/proxy.go:41 > Handling TCP connection address=dns-server:53 remoteAddr=10.8.110.1:47187
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/middlewares/tcp/ipallowlist/ip_allowlist.go:60 > Connection from 10.8.110.1:62773 accepted middlewareName=ipallowlist@file middlewareType=IPAllowListerTCP
2025-02-16T08:21:25-06:00 DBG github.com/traefik/traefik/v3/pkg/tcp/proxy.go:41 > Handling TCP connection address=dns-server:53 remoteAddr=10.8.110.1:62773
2025-02-16T08:21:26-06:00 DBG github.com/traefik/traefik/v3/pkg/tcp/proxy.go:104 > Error while terminating TCP connection error="close tcp 172.19.0.3:53->10.8.110.1:62773: use of closed network connection"
Perhaps this is normal?? Anyway to help debug the situation here is the section of my docker compose file for both the services:
- traefik
- dns-server
(for ease of experimentation I'm configuring the tcp routers for the dns-server container using the file yaml method rather than docker labels)
traefik:
image: traefik:latest
container_name: traefik
hostname: traefik
restart: always
networks:
- net
ports:
- 80:80
- 443:443
- 3000:3000
- 853:853
- 53:53
command:
- --accesslog.fields.names.StartUTC=drop
healthcheck:
test: traefik healthcheck --ping
<<: *healthcheck-parameters
<<: *log-parameters
...
...
dns-server:
container_name: dns-server
hostname: ns1.gohilton.com
image: technitium/dns-server:latest
restart: unless-stopped
healthcheck:
<<: *technitium-healthcheck
networks:
- net
ports:
- "5380:5380/tcp" #DNS web console (HTTP)
- "53443:53443/tcp" #DNS web console (HTTPS)
- "53:53/udp" #DNS service
expose:
- "8053/tcp" #DNS-over-HTTP service (use with reverse proxy)
- "853/tcp" #DNS over TLS
- "53/tcp"
For my traefik static configuration file, I have the following (/etc/traefik/traefik.yml):
entryPoints:
web:
address: :80
forwardedHeaders:
insecure: true
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: :443
forwardedHeaders:
insecure: true
ping:
address: :3000
dot:
address: :853
tcp:
address: :53
My tcp router configuration (/etc/traefik/conf.d/tcp.yml):
---
tcp:
routers:
router-tcp:
rule: "ClientIP(`10.8.110.0/24`)"
entryPoints:
- tcp
middlewares:
- ipallowlist
service: sv-tcp
middlewares:
ipallowlist:
ipAllowList:
sourceRange:
- "10.8.110.1/24"
- "10.0.1.1/24"
- "172.19.0.0/16"
services:
sv-tcp:
loadBalancer:
servers:
- address: "dns-server:53"
Are the errors I'm getting normal in the traefik log?