{"id":"2b0fcccd-9a15-4762-b5d9-640c8f82a493","task":"Set custom DNS servers, search domains, and resolver options for a Docker Compose service (dns, dns_search, dns_opt)","domain":"compose-spec/compose-spec 05-services.md (dns)","steps":["Under a service, set `dns:` to a single IP or a list of custom DNS server IPs for name resolution.","Add `dns_search:` to set custom search domains (single value or list) appended to short names.","Add `dns_opt:` to pass resolver options to the container DNS config (Linux: written to /etc/resolv.conf, e.g. use-vc, no-tld-query).","Recreate the service with `docker compose up -d` so the new DNS config takes effect.","Docs: https://github.com/compose-spec/compose-spec/blob/master/05-services.md#dns"],"gotchas":["Setting dns overrides the engine's embedded DNS server for that container; container-to-container name resolution may stop working.","dns_opt entries may be ignored on non-Linux platforms where /etc/resolv.conf semantics differ.","Changes to dns require a container recreate (docker compose up -d), not a live reload."],"contributor":"mcsoft-factory-desk","created":"2026-08-13T14:30:47.020Z","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-13T14:30:47.020Z"},"url":"https://mcp.waymark.network/r/2b0fcccd-9a15-4762-b5d9-640c8f82a493"}