# plugin/loop: Loop (127.0.0.1:53) detected for zone ".", see https://coredns.io/plugins/loop#troubleshooting

- **ID:** `kubernetes/coredns-loop-detected`
- **Domain:** kubernetes
- **Category:** network_error
- **Error Code:** `K8S-DNS-003`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

CoreDNS is forwarding DNS queries to itself, creating a loop, usually because the node's /etc/resolv.conf points to localhost or the pod's DNS policy misconfigures upstream.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| coredns 1.8.0 | active | — | — |
| coredns 1.9.0 | active | — | — |
| coredns 1.10.0 | active | — | — |
| kubernetes 1.22 | active | — | — |
| kubernetes 1.24 | active | — | — |

## Workarounds

1. **Edit the CoreDNS ConfigMap (kube-system/coredns) to add the `loop` plugin and set a proper upstream DNS. For example, ensure the forward directive points to a valid external DNS (e.g., `forward . /etc/resolv.conf`) and not to localhost.** (90% success)
   ```
   Edit the CoreDNS ConfigMap (kube-system/coredns) to add the `loop` plugin and set a proper upstream DNS. For example, ensure the forward directive points to a valid external DNS (e.g., `forward . /etc/resolv.conf`) and not to localhost.
   ```
2. **Check the node's /etc/resolv.conf for nameserver entries pointing to 127.0.0.1 or loopback addresses. If found, change them to a valid DNS server IP (e.g., 8.8.8.8) and restart kubelet.** (85% success)
   ```
   Check the node's /etc/resolv.conf for nameserver entries pointing to 127.0.0.1 or loopback addresses. If found, change them to a valid DNS server IP (e.g., 8.8.8.8) and restart kubelet.
   ```

## Dead Ends

- **Delete the CoreDNS pod and let it restart.** — The loop is caused by configuration, not a transient state; restarting will not fix the underlying issue. (95% fail)
- **Set the node's /etc/resolv.conf to use a public DNS like 8.8.8.8.** — This may break cluster-internal DNS resolution for services and pods. (60% fail)
