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
#Customer intent: As an Azure Kubernetes user, I want to learn how to create a troubleshooting workflow so that I can fix LocalDNS problems in Azure Kubernetes Service (AKS).
13
13
---
14
14
# Troubleshoot issues with LocalDNS on Azure Kubernetes Service (AKS)
15
-
This article discusses how to create a troubleshooting workflow to fix Domain Name System (DNS) resolution problems in Microsoft Azure Kubernetes Service (AKS), specifically when using LocalDNS. To learn more about LocalDNS, you can read our overview in [DNS Resolution in Azure Kubernetes Service (AKS)](https://learn.microsoft.com/en-us/azure/aks/dns-concepts#localdns-in-azure-kubernetes-service-preview).
15
+
This article discusses how to create a troubleshooting workflow to fix Domain Name System (DNS) resolution problems in Azure Kubernetes Service (AKS), when using LocalDNS. To learn more about LocalDNS, you can read our overview in [DNS Resolution in Azure Kubernetes Service (AKS)](https://learn.microsoft.com/en-us/azure/aks/dns-concepts#localdns-in-azure-kubernetes-service-preview).
16
16
17
17
## Prerequisites
18
18
@@ -26,13 +26,13 @@ This article discusses how to create a troubleshooting workflow to fix Domain Na
26
26
27
27
## Identifying patterns in DNS failures
28
28
Before you begin diagnosing the issues seen with LocalDNS, identify potential patterns with your DNS failures. Some patterns include:
29
-
1. DNS resolution failure - is this happening allways or intermittently
30
-
2. Are you seeing the DNS issues from all the nodes, a specific nodepool or subset of nodes or just a single node?
29
+
1. DNS resolution failure - is this happening all the time or intermittently?
30
+
2. Are you seeing the DNS issues from all the nodes, a specific node pool, or subset of nodes or just a single node?
31
31
3. Are you seeing DNS issues from nodes in a specific Azure Zone? Or from all the zones?
32
-
4. What protocols are failing? Is it both TCP and UDP? or just one of them?
32
+
4. What protocols are failing? Is it both TCP (Transmission Control Protocol) and UDP (User Datagram Protocol), or just one of them?
33
33
5. What zones are failing? Is it all zones? or a specific zone traffic?
34
34
35
-
**Note:** "zones" here refers to the DNS zones like *cluster.local* and *"."* (root) and not to physical zones in Azure.
35
+
**Note:** "zones" here refers to the DNS zones like *cluster.local* and root (.) and not to physical zones in Azure.
36
36
37
37
## Diagnose LocalDNS with a test DNSUtil pod
38
38
@@ -42,7 +42,7 @@ Option 1 - Deploy a test pod to your cluster using the following command:
Option 2 - If you are seeing DNS issues in specific nodes, you can control the deployment of the test pod using nodeSelector:
45
+
Option 2 - If you're seeing DNS issues in specific nodes, you can control the deployment of the test pod using nodeSelector:
46
46
47
47
```bash
48
48
cat <<EOF | kubectl create -f -
@@ -97,11 +97,11 @@ Option 3 - If you run both linux and windows nodes in your cluster, you can conf
97
97
98
98
### Enable Query logging for LocalDNS
99
99
100
-
Most use cases require query logging to be turned off in production because of its high memory usage and performance implications. However, fortroubleshooting purposes, you should enable query loggingin your localDNS configuration to root cause the source of your errors. Once the analyses is complete, you can turn this back off.
100
+
Most use cases require query logging to be turned off in production because of its high memory usage and performance implications. However, fortroubleshooting purposes, you should enable query loggingin your localDNS configuration to root cause the source of your errors. Once the analysis is complete, you can turn it off.
101
101
102
102
Option 1 - Enable Query logging on all nodes
103
103
104
-
You can modify your LocalDNS configuration to reflect *Querylogging:Log*for a single or multiple DNS zones.
104
+
You can modify your LocalDNS configuration to reflect *queryLogging: Log*for a single or multiple DNS zones.
105
105
106
106
```json
107
107
{
@@ -153,19 +153,19 @@ You can modify your LocalDNS configuration to reflect *Querylogging:Log* for a s
153
153
}
154
154
```
155
155
156
-
This can be enabled on the node pool using the Azure CLI
156
+
You can enable this change on the node pool using the Azure CLI
157
157
158
158
```bash
159
159
az aks nodepool update --name mynodepool1 --cluster-name myAKSCluster --resource-group myResourceGroup --localdns-config ./localdnsconfig.json
160
160
```
161
161
162
-
**Note:** Making changes to the LocalDNS configuration will trigger a reimage operation on the nodes in the given node pool.
162
+
**Note:** Making changes to the LocalDNS configuration triggers a reimage operation in the chosen node pool.
163
163
164
164
Option 2 - Enable Query logging on a specific node
165
165
166
-
Diagnosing LocalDNS issues on a specific node can be doneby temporarily rewriting the LocalDNS configuration on that specific node. You can [connect to the node](https://learn.microsoft.com/en-us/azure/aks/node-access#connect-using-kubectl-debug) manually and update the corefile used by localdns, only restarting the specific localdns service.
166
+
You can diagnose LocalDNS issues on a specific node by temporarily rewriting the LocalDNS configuration. You can [connect to the node](https://learn.microsoft.com/en-us/azure/aks/node-access#connect-using-kubectl-debug) manually and update the core file used by LocalDNS, only restarting the specific LocalDNS service.
167
167
168
-
**Note:** The changes made this way are ephemeral in nature and will not be persisted once the troubleshooting is complete.
168
+
**Note:** The changes made this way are ephemeral in nature and don't persist once the troubleshooting is complete.
169
169
170
170
```bash
171
171
# You need to connect to the node before running the following commands
@@ -234,13 +234,13 @@ cluster.local:53 {
234
234
...
235
235
<Save the changes>
236
236
237
-
<Restart localdns service>
237
+
<Restart localDNS service>
238
238
systemctl restart localdns
239
239
```
240
240
241
241
Once restarted, LocalDNS should begin collecting all logs for the chosen zones.
242
242
243
-
### Generater traffic from dnsutils pod
243
+
### Generate traffic from dnsutils pod
244
244
245
245
The next step would be to trigger some DNS traffic on LocalDNS. LocalDNS has two IPs - The KubeDNS traffic goes to the ClusterListenerIP - 169.254.10.11, while VnetDNSTraffic goes to the NodeListenerIP - 169.254.10.10#53
246
246
@@ -294,7 +294,7 @@ bing.com. 1315 IN A 150.171.27.10
294
294
295
295
### View LocalDNS logs collected
296
296
297
-
Lastly, you can now view the logs from your LocalDNS instances. Connect to the specific node and run the following commands to view the logs
297
+
Lastly, you can now view the logs from your LocalDNS instances. To view the logs, you can connect to the node and run the following commands.
Jul 03 16:59:07 aks-userpool-24995383-vmss000000 localdns-coredns[2491520]: [INFO] 10.244.0.95:58454 - 3580 "A IN bing.com. udp 26 false 512" NOERROR qr,rd,ra 74 0.001570158s
313
313
```
314
314
315
-
If you see logs for your traffic, the pod has successfully been able to reach the localdns service.
315
+
If you see logs for your traffic, the pod is able to reach the LocalDNS service.
316
316
317
317
## Next steps
318
-
If the above logs fail to help root cause the issue, you can enable [Queryloggingfor CoreDNS](https://learn.microsoft.com/en-us/azure/aks/coredns-custom#enable-dns-query-logging) to validate if CoreDNS is working as intended.
318
+
If the above logs fail to help root cause the issue, you can enable [Query logging for CoreDNS](https://learn.microsoft.com/en-us/azure/aks/coredns-custom#enable-dns-query-logging) to validate if CoreDNS is working as intended.
319
319
320
320
[!INCLUDE [Azure Help Support](../../../../includes/azure-help-support.md)]
0 commit comments