0
0
Kubernetesdevops~10 mins

DNS in Kubernetes (CoreDNS) - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to check the CoreDNS pods in the kube-system namespace.

Kubernetes
kubectl get pods -n [1] -l k8s-app=kube-dns
Drag options to blanks, or click blank then click option'
Adns
Bdefault
Ccore-dns
Dkube-system
Attempts:
3 left
💡 Hint
Common Mistakes
Using the default namespace instead of kube-system
Using an incorrect label selector
2fill in blank
medium

Complete the command to view the CoreDNS ConfigMap in the kube-system namespace.

Kubernetes
kubectl get configmap [1] -n kube-system -o yaml
Drag options to blanks, or click blank then click option'
Acoredns-config
Bcoredns
Cdns-config
Dcore-dns-configmap
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect ConfigMap names like coredns-config
Forgetting the namespace flag
3fill in blank
hard

Fix the error in the CoreDNS ConfigMap snippet to correctly forward DNS queries to 8.8.8.8.

Kubernetes
forward . [1]
Drag options to blanks, or click blank then click option'
A8.8.8.8:5353
B8.8.8.8
C8.8.8.8:53
D8.8.4.4
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the port number
Using wrong port like 5353
Using wrong IP address
4fill in blank
hard

Fill both blanks to create a CoreDNS stub domain forwarding example for example.com to 10.0.0.1.

Kubernetes
example.com:53 {
    [1] . [2]
}
Drag options to blanks, or click blank then click option'
Aforward
Bproxy
C10.0.0.1
D8.8.8.8
Attempts:
3 left
💡 Hint
Common Mistakes
Using the deprecated proxy plugin
Using wrong IP address
Swapping plugin and IP positions
5fill in blank
hard

Fill all three blanks to create a CoreDNS hosts plugin block mapping example.com to 10.0.0.2 with TTL 30.

Kubernetes
hosts {
    [1] [2] [3]
    fallthrough
}
Drag options to blanks, or click blank then click option'
A10.0.0.2
Bexample.com
C30
Dexample.net
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping domain and IP positions
Using wrong TTL value
Using wrong domain name