I tried to use Traefik in front of a DNS server (AdGuard Home) to load balance UDP and TCP DNS requests.
Both AdGuard and traefik are on the same docker host.
traefik.yml config
entryPoints:
dns53t:
address: :53/tcp
dns53u:
address: :53/udp
adguard docker compose labels
# port 53 tcp
- "traefik.tcp.routers.adguard53t.entrypoints=dns53t"
- "traefik.tcp.routers.adguard53t.rule=HostSNI(`*`)"
- "traefik.tcp.routers.adguard53t.service=adguard53t"
- "traefik.tcp.services.adguard53t.loadbalancer.server.port=53"
# port 53 udp
- "traefik.udp.routers.adguard53u.entrypoints=dns53u"
- "traefik.udp.routers.adguard53u.service=adguard53u"
- "traefik.udp.services.adguard53u.loadbalancer.server.port=53"
But in adguard logs the client ip is showing the ip of traefik docker container.
I know passing headers is not relevant to TCP/UDP but I can't overcome this issue.
In AdGuard i use different settings (blocking services) by the source ip.
Does anyone have any ideas?
Thank you