<p>i have been trying to setup k8s in a single node,everything was installed fine. but when i check the status of my kube-system pods, </p>

<p><strong>CNI -> flannel</strong> pod has <strong>crashed</strong>, reason ->  Nameserver limits were exceeded, some nameservers have been omitted, the applied nameserver line is: x.x.x.x x.x.x.x x.x.x.x</p>

<p><strong>CoreDNS</strong> pods status is <strong>ContainerCreating</strong>.</p>

<p>In My Office, the current server has been configured to have an static ip and when i checked <strong>/etc/resolv.conf</strong></p>

<p>This is the output</p>

<pre><code># Generated by NetworkManager
search ORGDOMAIN.BIZ
nameserver 192.168.1.12
nameserver 192.168.2.137
nameserver 192.168.2.136
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 192.168.1.10
nameserver 192.168.1.11
</code></pre>

<p>i'm unable to find the root cause, what should i be looking at?</p>

Sriram Arvind Lakshmanakumar
<p>In short, you have too many entries in <code>/etc/resolv.conf</code>.</p>
<p>This is a <a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/#known-issues" rel="noreferrer">known issue</a>:</p>
<blockquote>
<p>Some Linux distributions (e.g. Ubuntu), use a local DNS resolver by default (systemd-resolved). Systemd-resolved moves and replaces <code>/etc/resolv.conf</code> with a stub file that can cause a fatal forwarding loop when resolving names in upstream servers. This can be fixed manually by using kubelet’s <code>--resolv-conf</code> flag to point to the correct <code>resolv.conf</code> (With <code>systemd-resolved</code>, this is <code>/run/systemd/resolve/resolv.conf</code>). <strong>kubeadm (&gt;= 1.11) automatically detects <code>systemd-resolved</code>, and adjusts the kubelet flags accordingly.</strong></p>
</blockquote>
<p>Also</p>
<blockquote>
<p>Linux’s libc is impossibly stuck (<a href="https://bugzilla.redhat.com/show_bug.cgi?id=168253" rel="noreferrer">see this bug from 2005</a>) with limits of just 3 DNS  <code>nameserver</code>  records and 6 DNS  <code>search</code>  records. Kubernetes needs to consume 1  <code>nameserver</code>  record and 3  <code>search</code>  records. This means that if a local installation already uses 3  <code>nameserver</code>s or uses more than 3  <code>search</code>es, some of those settings will be lost. As a partial workaround, the node can run  <code>dnsmasq</code>  which will provide more  <code>nameserver</code>  entries, but not more  <code>search</code>  entries. You can also use kubelet’s  <code>--resolv-conf</code>  flag.</p>
<p>If you are using Alpine version 3.3 or earlier as your base image, DNS may not work properly owing to a known issue with Alpine. Check  <a href="https://github.com/kubernetes/kubernetes/issues/30215" rel="noreferrer">here</a>  for more information.</p>
</blockquote>
<p>You possibly could change that in the Kubernetes code, but I'm not sure about the functionality. As it's set to that value for purpose.</p>
<p>Code can be located <a href="https://github.com/kubernetes/kubernetes/blob/c970a46bc1bcc100bbbfabd5c12bd4c5d87f8aea/pkg/apis/core/validation/validation.go#L2944-L2953" rel="noreferrer">here</a></p>
<pre><code>const (
    // Limits on various DNS parameters. These are derived from
    // restrictions in Linux libc name resolution handling.
    // Max number of DNS name servers.
    MaxDNSNameservers = 3
    // Max number of domains in search path.
    MaxDNSSearchPaths = 6
    // Max number of characters in search path.
    MaxDNSSearchListChars = 256
)
</code></pre>
