Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Demonstrate Docker for Mac issue with priviledged UDP ports for DNS: https://github.com/docker/for-mac/issues/3775
#!/bin/bash
function :: {
echo "==> $@"
"$@"
}
test_dir="$(mktemp -d -t dnstest)"
:: cd "${test_dir}"
cat > docker-compose.yml <<-EOT
version: "3.5"
services:
dnsmasq:
image: jpillora/dnsmasq
ports:
- "127.0.0.1:53:53/udp"
- "127.0.0.1:1024:53/udp"
- "127.0.0.1:1025:53/udp"
- "127.0.0.1:5000:53/udp"
- "127.0.0.1:53:53/tcp"
- "127.0.0.1:1024:53/tcp"
- "127.0.0.1:1025:53/tcp"
- "127.0.0.1:5000:53/tcp"
EOT
:: docker-compose up -d
:: dig +noall +answer apple.com @127.0.0.1 -p 53
:: dig +noall +answer apple.com @127.0.0.1 -p 1024
:: dig +noall +answer apple.com @127.0.0.1 -p 1025
:: dig +noall +answer apple.com @127.0.0.1 -p 5000
:: dig +tcp +noall +answer apple.com @127.0.0.1 -p 53
:: dig +tcp +noall +answer apple.com @127.0.0.1 -p 1024
:: dig +tcp +noall +answer apple.com @127.0.0.1 -p 1025
:: dig +tcp +noall +answer apple.com @127.0.0.1 -p 5000
:: docker-compose down -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.