New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Docker DCA Exam - Topic 1 Question 119 Discussion

Actual exam question for Docker's DCA exam
Question #: 119
Topic #: 1
[All DCA Questions]

Does this command create a swarm service that only listens on port 53 using the UDP protocol?

Solution. 'docker service create -name dns-cache -p 53:53/udp dns-cache"

Show Suggested Answer Hide Answer
Suggested Answer: B

= The command 'docker service create -name dns-cache -p 53:53/udp dns-cache' is not correct and will not create a swarm service that only listens on port 53 using the UDP protocol. There are two errors in the command:

The option-nameshould be--namewith two dashes, otherwise it will be interpreted as a short option-nfollowed by an argumentame1.

The option-por--publishwill publish the service port to the host port, which means the service will be reachable from outside the swarm2.To create a service that only listens on the internal network, you need to use the--publish-addoption with themode=ingressflag3.

The correct command should be:

docker service create --name dns-cache --publish-add mode=ingress,target=53,published=53,protocol=udp dns-cache

:

docker service create | Docker Docs

Publish ports on the host | Docker Docs

Publish a port for a service | Docker Docs


Contribute your Thoughts:

0/2000 characters
Chau
9 hours ago
Seems right, but I thought it needed TCP too.
upvoted 0 times
...
Colette
6 days ago
Wait, is it really only UDP?
upvoted 0 times
...
Louvenia
11 days ago
Definitely creates a service for DNS.
upvoted 0 times
...
Rodolfo
16 days ago
Yes, it maps port 53 for UDP.
upvoted 0 times
...
Carin
21 days ago
Wait, does this mean I can't use my microwave while the DNS service is running? Asking for a friend.
upvoted 0 times
...
Lamonica
26 days ago
A) Yes, the command creates a swarm service that listens on port 53 using UDP. Easy peasy!
upvoted 0 times
...
Emelda
1 month ago
B) No, this command doesn't create a swarm service. It creates a container with the name "dns-cache" that listens on port 53 using UDP.
upvoted 0 times
...
Pa
1 month ago
I believe the command does create a service for port 53, but I need to double-check if it only listens on UDP as stated.
upvoted 0 times
...
Clemencia
1 month ago
I'm a bit confused about the `-name` flag; I thought it was supposed to be `--name`. Does that affect the command?
upvoted 0 times
...
Genevive
2 months ago
I remember practicing a similar question, and I think the port mapping looks right for a swarm service.
upvoted 0 times
...
Kina
2 months ago
The command looks straightforward to me. The -p 53:53/udp part clearly indicates it's listening on UDP port 53, so I'll select A for this one.
upvoted 0 times
...
Erin
2 months ago
Wait, I'm a little confused. Does the "dns-cache" part mean it's a specific DNS caching service, or is that just the name of the service? I want to make sure I understand the full context before answering.
upvoted 0 times
...
Trinidad
2 months ago
Okay, I'm pretty confident this command sets up a UDP service on port 53. The -p 53:53/udp part seems to specify that. I'll go with A.
upvoted 0 times
...
Stefany
2 months ago
I think the command is correct since it specifies the UDP protocol, but I'm not entirely sure about the syntax.
upvoted 0 times
...
King
2 months ago
Looks good to me! Now I can finally stop using my neighbor's WiFi password.
upvoted 0 times
...
Layla
3 months ago
I think it's A) Yes. It specifies UDP.
upvoted 0 times
...
Shelton
3 months ago
Yes, this command creates a swarm service that listens on port 53 using the UDP protocol.
upvoted 0 times
...
Hollis
3 months ago
Hmm, I'm not totally sure about this one. The command looks right, but I want to double-check the documentation to be certain. I'll have to think it through a bit more.
upvoted 0 times
...
Elizabeth
3 months ago
I think this command does create a swarm service that listens on port 53 using UDP, so I'll go with A.
upvoted 0 times
...

Save Cancel