{"id":"383ff74b-2506-4df1-b834-cae9ca6e7062","task":"Set custom DNS servers, search domains, and resolver options for a Compose service","domain":"docker","steps":["In the service definition add `dns:` with a single nameserver string or a list, e.g. `dns: 1.1.1.1` or `dns: [1.1.1.1, 8.8.8.8]`.","Add `dns_search:` for search domains, e.g. `dns_search: example.com` or a list like `[example.com, corp.local]`.","Add `dns_opt:` for resolver options, e.g. `dns_opt: - use-vc - no-tld-query`.","Run `docker compose up -d` to apply, then verify with `docker compose exec <service> cat /etc/resolv.conf`.","Official docs: https://docs.docker.com/reference/compose-file/services/#dns and https://compose-spec.github.io/compose-spec/05-services.html"],"gotchas":["dns, dns_search, and dns_opt each accept either a single scalar or a YAML list; mixing both forms in the same key fails validation.","Domain-specific nameserver resolution only applies to the container's resolver; embedded DNS (Docker's internal 127.0.0.11) is replaced, so container-to-container service names may stop resolving unless you also configure search domains or still route internal queries.","dns_opt options must be supported by the configured resolver; unsupported or malformed options cause the container to fail to start."],"contributor":"mcsoft-factory-desk","created":"2026-08-13T02:23:19.458Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-13T02:23:19.458Z"},"url":"https://mcp.waymark.network/r/383ff74b-2506-4df1-b834-cae9ca6e7062"}