Skip to content

Commit b80bfa3

Browse files
committed
Addressing GitIssues
1 parent 82f77ff commit b80bfa3

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

articles/aks/coredns-custom.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You can customize CoreDNS with AKS to perform on-the-fly DNS name rewrites.
4444
name: coredns-custom
4545
namespace: kube-system
4646
data:
47-
test.server: | # you may select any name here, but it must end with the .server file extension
47+
test.override: |
4848
<domain to be rewritten>.com:53 {
4949
log
5050
errors
@@ -71,7 +71,7 @@ You can customize CoreDNS with AKS to perform on-the-fly DNS name rewrites.
7171
kubectl get configmaps --namespace=kube-system coredns-custom -o yaml
7272
```
7373

74-
4. Force CoreDNS to reload the ConfigMap using the [`kubectl delete pod`][kubectl delete] command and the `kube-dns` label. This command isn't destructive and doesn't cause downtime. It deletes the `kube-dns` pods, and then the Kubernetes Scheduler recreates them. The new pods contain the change in TTL value.
74+
4. Force CoreDNS to reload the ConfigMap using the [`kubectl delete pod`][kubectl delete] command and the `kube-dns` label. This command deletes the `kube-dns` pods, and then the Kubernetes Scheduler recreates them. The new pods contain the change in TTL value.
7575

7676
```console
7777
kubectl delete pod --namespace kube-system -l k8s-app=kube-dns
@@ -105,7 +105,7 @@ If you need to specify a forward server for your network traffic, you can create
105105
3. Force CoreDNS to reload the ConfigMap using the [`kubectl delete pod`][kubectl delete] so the Kubernetes Scheduler can recreate them.
106106

107107
```console
108-
kubectl delete pod --namespace kube-system --selector k8s-app=kube-dns
108+
kubectl delete pod --namespace kube-system -l k8s-app=kube-dns
109109
```
110110

111111
## Use custom domains
@@ -138,7 +138,7 @@ You may want to configure custom domains that can only be resolved internally. F
138138
3. Force CoreDNS to reload the ConfigMap using the [`kubectl delete pod`][kubectl delete] so the Kubernetes Scheduler can recreate them.
139139

140140
```console
141-
kubectl delete pod --namespace kube-system --selector k8s-app=kube-dns
141+
kubectl delete pod --namespace kube-system -l k8s-app=kube-dns
142142
```
143143

144144
## Stub domains
@@ -177,7 +177,7 @@ CoreDNS can also be used to configure stub domains.
177177
3. Force CoreDNS to reload the ConfigMap using the [`kubectl delete pod`][kubectl delete] so the Kubernetes Scheduler can recreate them.
178178

179179
```console
180-
kubectl delete pod --namespace kube-system --selector k8s-app=kube-dns
180+
kubectl delete pod --namespace kube-system -l k8s-app=kube-dns
181181
```
182182

183183
## Hosts plugin
@@ -204,7 +204,9 @@ data:
204204

205205
For general CoreDNS troubleshooting steps, such as checking the endpoints or resolution, see [Debugging DNS resolution][coredns-troubleshooting].
206206

207-
To enable DNS query logging, apply the following configuration in your coredns-custom ConfigMap:
207+
### Enable DNS query logging
208+
209+
1. Add the following configuration to your coredns-custom ConfigMap:
208210

209211
```yaml
210212
apiVersion: v1
@@ -217,10 +219,20 @@ data:
217219
log
218220
```
219221

220-
After you apply the configuration changes, use the `kubectl logs` command to view the CoreDNS debug logging.
222+
2. Apply the configuration changes and force CoreDNS to reload the ConfigMap using the following commands:
223+
224+
```console
225+
# Apply configuration changes
226+
kubectl apply -f corednsms.yaml
227+
228+
# Force CoreDNS to reload the ConfigMap
229+
kubectl delete pod --namespace kube-system -l k8s-app=kube-dns
230+
```
231+
232+
3. View the CoreDNS debug logging using the `kubectl logs` command.
221233

222234
```console
223-
kubectl logs --namespace kube-system --selector k8s-app=kube-dns
235+
kubectl logs --namespace kube-system -l k8s-app=kube-dns
224236
```
225237

226238
## Next steps

0 commit comments

Comments
 (0)