You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/aks/coredns-custom.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ You can customize CoreDNS with AKS to perform on-the-fly DNS name rewrites.
44
44
name: coredns-custom
45
45
namespace: kube-system
46
46
data:
47
-
test.server: |# you may select any name here, but it must end with the .server file extension
47
+
test.override: |
48
48
<domain to be rewritten>.com:53 {
49
49
log
50
50
errors
@@ -71,7 +71,7 @@ You can customize CoreDNS with AKS to perform on-the-fly DNS name rewrites.
71
71
kubectl get configmaps --namespace=kube-system coredns-custom -o yaml
72
72
```
73
73
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.
75
75
76
76
```console
77
77
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
105
105
3. Force CoreDNS to reload the ConfigMap using the [`kubectl delete pod`][kubectl delete] so the Kubernetes Scheduler can recreate them.
106
106
107
107
```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
109
109
```
110
110
111
111
## Use custom domains
@@ -138,7 +138,7 @@ You may want to configure custom domains that can only be resolved internally. F
138
138
3. Force CoreDNS to reload the ConfigMap using the [`kubectl delete pod`][kubectl delete] so the Kubernetes Scheduler can recreate them.
139
139
140
140
```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
142
142
```
143
143
144
144
## Stub domains
@@ -177,7 +177,7 @@ CoreDNS can also be used to configure stub domains.
177
177
3. Force CoreDNS to reload the ConfigMap using the [`kubectl delete pod`][kubectl delete] so the Kubernetes Scheduler can recreate them.
178
178
179
179
```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
181
181
```
182
182
183
183
## Hosts plugin
@@ -204,7 +204,9 @@ data:
204
204
205
205
For general CoreDNS troubleshooting steps, such as checking the endpoints or resolution, see [Debugging DNS resolution][coredns-troubleshooting].
206
206
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:
208
210
209
211
```yaml
210
212
apiVersion: v1
@@ -217,10 +219,20 @@ data:
217
219
log
218
220
```
219
221
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.
0 commit comments