nerdexam
Docker

DCA · Question #89

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 -service udp dns-cache'

The correct answer is B. No. The command provided incorrectly specifies the service name and uses an invalid flag for protocol, thus it would fail to create a service listening on port 53 using UDP.

Submitted by kwame.gh· Apr 18, 2026Container Orchestration

Question

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 -service udp dns-cache'

Options

  • AYes
  • BNo

How the community answered

(27 responses)
  • A
    22% (6)
  • B
    78% (21)

Why each option

The command provided incorrectly specifies the service name and uses an invalid flag for protocol, thus it would fail to create a service listening on port 53 using UDP.

AYes

The command contains syntactical errors, specifically using `-name` instead of `--name` and an unrecognized `-service udp` flag, which means it will not execute successfully to create a UDP-only service.

BNoCorrect

The command uses `-name` instead of `--name` (a single dash is typically for single-letter options), which would cause an error. More critically, the `-service udp` flag is not a valid or recognized option for `docker service create` to specify the protocol for port mapping; the correct way is within the `-p` flag's syntax, like `53:53/udp`.

Concept tested: Docker Swarm service creation syntax

Source: https://docs.docker.com/engine/reference/commandline/service_create/#publish-ports--p

Topics

#Docker Swarm#Service Creation#Port Publishing#UDP Protocol

Community Discussion

No community discussion yet for this question.

Full DCA Practice