nerdexam
Docker

DCA · Question #88

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'

The correct answer is A. Yes. The docker service create command with -p 53:53/udp correctly publishes port 53 for the service using only the UDP protocol.

Submitted by the_admin· 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/udp dns-cache'

Options

  • AYes
  • BNo

How the community answered

(32 responses)
  • A
    94% (30)
  • B
    6% (2)

Why each option

The `docker service create` command with `-p 53:53/udp` correctly publishes port 53 for the service using only the UDP protocol.

AYesCorrect

The `docker service create` command's `-p` or `--publish` flag syntax allows specifying the protocol (TCP or UDP) in the format `published_port:target_port/protocol`. By using `53:53/udp`, the command explicitly configures the service to expose port 53 on the swarm overlay network using only the UDP protocol.

BNo

The `-p` flag syntax `published_port:target_port/protocol` is the standard and correct way to specify a port and its associated protocol (UDP or TCP) when publishing a Docker Swarm service port.

Concept tested: Docker Swarm service port publishing

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

Topics

#Docker Swarm#Port Publishing#UDP#Service Creation

Community Discussion

No community discussion yet for this question.

Full DCA Practice