Score:0

Hoy to query by service name with endpoint_mode=dnsrr from host network

in flag
PRF

I'm configuring some databases in a swarm cluster environment to use endpoint-mode = dnsrr

Documentation says (https://docs.docker.com/network/overlay/):

"A DNS query for the service name on the Docker host returns a list of IP addresses for the nodes running the service"

I'm having trouble to understand what this sentence is saying.

If I use dig to query the service name, which dns server which I have to use?. Swarm manager (which I understand as docker host) is not running a DNS server as I know.

What I do know is that inside an overlay network you can resolve using tasks.$servicename, but for dnsrr and host network, how it is done?

Score:0
us flag

I agree the docs aren't full clear on this point, but on the following example, I have composed a service with two containers replicas:

  webx:
    restart: on-failure
    build: ./web
    hostname: webx
    deploy:
        replicas: 2
        endpoint_mode: dnsrr

Then, opening the console and running a nslookup using the service name, I understand that Docker is internally handling the service name "webx" as a DNS, and when I open network connections from another container to webx, it does the round robin behavior.

# nslookup webx
Server:         127.0.0.11
Address:        127.0.0.11#53

Non-authoritative answer:
Name:   webx
Address: 172.20.0.6
Name:   webx
Address: 172.20.0.5
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.