<p>I am running a k3s cluster on some raspberry pi 4, in my local network. I have a DNS server (dnsmasq) on the master nodes. I want that the pods of my cluster use that DNS server, via coredns. However when I ping an adress from within a pod I always pass via the google DNS servers and overpass my local DNS rules.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: ConfigMap
data:
  Corefile: |
    .:53 {
        errors
        health
        ready
        kubernetes cluster.local in-addr.arpa ip6.arpa {
          pods insecure
          upstream
          fallthrough in-addr.arpa ip6.arpa
        }
        hosts /etc/coredns/NodeHosts {
          reload 1s
          fallthrough
        }
        prometheus :9153
        forward . /etc/resolv.conf
        cache 30
        loop
        reload
        loadbalance
    }

</code></pre>
<p>this is my coredns config. As you see there is the <code>forward . /etc/resolv.conf </code></p>
<p>my /etc/resolv.conf</p>
<pre><code>domain home
nameserver 127.0.0.1
</code></pre>
<p>Any suggestions ?</p>

samsja
<p>thanks guys I change my coredns to</p>
<pre class="lang-yaml prettyprint-override"><code>kind: ConfigMap
metadata:
  annotations:
  name: coredns
  namespace: kube-system
apiVersion: v1
data:
  Corefile: |
    .:53 {
        errors
        health
        ready
        kubernetes cluster.local in-addr.arpa ip6.arpa {
          pods insecure
          upstream
          fallthrough in-addr.arpa ip6.arpa
        }
        hosts /etc/coredns/NodeHosts {
          reload 1s
          fallthrough
        }
        prometheus :9153
        forward . &lt;master node ip&gt;
        cache 30
        loop
        reload
        loadbalance
    }
  NodeHosts: |
    &lt;master node ip&gt; master
    &lt;slave node ip&gt; slave
</code></pre>
<p>and it worked !</p>
