Answers: <p>Assuming that "publicly available" is on the public internet it will be difficult.</p>
  
  <p>DNS isn't really that reactive to changes and is challenging to run in a secure fashion on the public internet.</p>
  
  <p>It also depends on what protocol you are running, because of an oddity around SRV records where pre-existing protocols were excluded from supporting it in the RFC.</p>
  
  <p>But in general the public and the private solution I would implement are similar with an additional layer for a public internet solution. (assuming no use of a 3rd party or geo specific answers)</p>
  
  <p>On the internet edge use <a href="https://www.unbound.net/" rel="nofollow noreferrer">Unbound DNS server</a> on the edge, and have it relay queries to <a href="https://www.consul.io/docs/agent/dns.html" rel="nofollow noreferrer">consul</a> which would handle service registration.</p>
  
  <p>If this is for private usage this would allow for some data-center awareness and fail-over.</p>
  
  <p>If it is just for internal use you can just use consul and either configure your internal DNS servers to delegate subdomains or forward to the default domain.</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-06-26T20:48:39.310Z
Answers: Direct DNS changes could be problematic if you're making AAAA record updates at a rapid rate (faster than cache expiring or a zone transfer from a private BIND to public NS server).  What's the expected DNS update frequency?
Answers: Chase
Answers: CC BY-SA 3.0
Answers: 2017-05-19T23:10:46.057Z
Answers: 2017-05-19T23:10:46.057Z
Answers: gdahlm
Body: <p>I'm trying to understand how I would set up a Docker container (running in Swarm mode) with publicly available IPv6.</p>
  
  <p>I know Docker Swarm uses mesh routing, but I don't quite understand how I can dynamically assign DNS names to addresses.</p>
  
  <p>As an example, let's say I want to run a Git server (with HTTP 80 443 and SSH 22) on <code>git.example.com</code> and a regular web server at <code>example.com</code> (with HTTP 80 443). Both have public IPv6 addresses, but I don't want to hard-code the IPv6 address (for example at CloudFlare). After all, this is DevOps!</p>
  
  <p>How would I go about doing this? I assume I need to run my own DNS server for this.</p>
  
  <p><strong>Note</strong>: After doing some more research, it seems this is possible with the <a href="https://docs.docker.com/datacenter/ucp/2.1/guides/admin/configure/use-domain-names-to-access-services/" rel="nofollow noreferrer">Docker HTTP Routing Mesh (HRM)</a> which is unfortunately only part of the Enterprise Edition. Does anyone know a similar, open-source approach to this?</p>
  
Tags: <docker><docker-swarm>
Title: Assign DNS name to Docker Swarm containers with public IPv6
UserDisplayName: JacksGT
ThreadText: # Assign DNS name to Docker Swarm containers with public IPv6
  
  (Asked by: username_0 on 2017-05-09)
  
  I'm trying to understand how I would set up a Docker container (running in Swarm mode) with publicly available IPv6.
  
  I know Docker Swarm uses mesh routing, but I don't quite understand how I can dynamically assign DNS names to addresses.
  
  As an example, let's say I want to run a Git server (with HTTP 80 443 and SSH 22) on `git.example.com` and a regular web server at `example.com` (with HTTP 80 443). Both have public IPv6 addresses, but I don't want to hard-code the IPv6 address (for example at CloudFlare). After all, this is DevOps!
  
  How would I go about doing this? I assume I need to run my own DNS server for this.
  
  **Note**: After doing some more research, it seems this is possible with the [Docker HTTP Routing Mesh (HRM)](https://docs.docker.com/datacenter/ucp/2.1/guides/admin/configure/use-domain-names-to-access-services/) which is unfortunately only part of the Enterprise Edition. Does anyone know a similar, open-source approach to this?
  
  **Tags:** docker, docker-swarm
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-05-19. Score: 3
  
  Assuming that "publicly available" is on the public internet it will be difficult.
  
  DNS isn't really that reactive to changes and is challenging to run in a secure fashion on the public internet.
  
  It also depends on what protocol you are running, because of an oddity around SRV records where pre-existing protocols were excluded from supporting it in the RFC.
  
  But in general the public and the private solution I would implement are similar with an additional layer for a public internet solution. (assuming no use of a 3rd party or geo specific answers)
  
  On the internet edge use [Unbound DNS server](https://www.unbound.net/) on the edge, and have it relay queries to [consul](https://www.consul.io/docs/agent/dns.html) which would handle service registration.
  
  If this is for private usage this would allow for some data-center awareness and fail-over.
  
  If it is just for internal use you can just use consul and either configure your internal DNS servers to delegate subdomains or forward to the default domain.
  
  > **Comments:**
  > **username_2**: Direct DNS changes could be problematic if you're making AAAA record updates at a rapid rate (faster than cache expiring or a zone transfer from a private BIND to public NS server).  What's the expected DNS update frequency?  
  
  ---
  
  