My PHP app makes HTTP requests from the server to itself. That is, the PHP container for serving the domain
example.com makes requests to
example.com (or other domains that I host on my Docker servers).
I would like to be able to add A or CNAME records to Docker’s internal DNS so these requests are resolved to the web proxy I have for incoming requests to the cluster.
Currently, these requests are resolved by my public DNS server (at Cloudflare) for my hosted domains. This works in production but doesn’t work for my staging/testing clusters since the PHP containers making these requests always use the public DNS resolver which only serves the IPs of the public web proxies and not the web proxies in the staging/testing clusters.
I could deploy my own DNS server for DNS name resolution from within the cluster, but it would be a whole lot more convenient to simply be able to add names to the built-in internal DNS server.
So, my feature request is to open up the internal DNS server by adding Docker CLI commands to add/retrieve/remove records in the internal DNS server.