Tailscale version: 1.36.2
Your operating system & version: Fedora 37
Hi!
I’m trying to set up caddy as a reverse proxy to tailscale services using magic dns. This works with the network: host
option but for some reason does not work using standard bridge networks.
What confuses me is
$ docker run --rm -it alpine ping fedora
PING fedora (100.XX.XX.XX): 56 data bytes
seems to work fine, but when I run the following docker-compose.yml
:
---
version: "3.4"
networks:
default:
name: server-compose-network
attachable: true
services:
alpine:
container_name: alpine
tty: true
image: alpine
restart: always
privileged: true
I get the following error:
$ docker-compose --verbose exec alpine ping fedora
ping: bad address 'fedora'
However, pinging with the tailscale IP address works:
$ docker-compose --verbose exec alpine ping 100.XXX.XXX.XX
64 bytes from 100.XXX.XXX.XX: seq=0 ttl=63 time=66.605 ms
Is there some difference in the networking configuration of docker-compose that I need to be aware of to access my host dns?
The issue appears to be /etc/resolv.conf
is different between the two servers:
docker-compose (does not work)
/ # cat /etc/resolv.conf
search tailxxxe.ts.net xxxx.xxxx.com.beta.tailscale.net
nameserver 127.0.0.11
options edns0 trust-ad ndots:0
docker run (works)
/ # cat /etc/resolv.conf
nameserver 205.185.112.68
nameserver 205.185.112.69
nameserver 100.100.100.100
search tailxxxe.ts.net xxxx.xxxx.com.beta.tailscale.net
Furthermore, if I create a network:
$ docker network create proxy
$ docker run --rm --network=proxy -it alpine sh
/ # ping fedora
ping: bad address 'fedora'