Final answer:
To configure Docker to use external DNS for all containers started on a Docker machine, the correct option is D) docker network create --dns my-network.
Step-by-step explanation:
Configuring Docker to utilize external DNS for all containers involves creating a Docker network with the desired DNS settings. This ensures that containers connected to this network use the specified DNS configuration.
Using the docker network create command allows you to create a custom network, and by appending the --dns flag followed by the DNS server address, you define the DNS server for that network. This means that any container attached to this network will automatically use the specified external DNS server.
Unlike the other options presented:
Option A (docker run --dns= my-container) is incorrect as it only sets the DNS for a specific container during its runtime, not for all containers.
Option B (docker config --dns) is not a valid command for setting DNS at the network level; it's more related to configuring swarm services.
Option C (docker daemon --dns) is also incorrect, as there is no direct --dns flag for the Docker daemon to set DNS globally for all containers.
In conclusion, the appropriate command for configuring Docker to use external DNS for all containers is D) docker network create --dns my-network.