<p>I would like to resolve the kube-dns names from outside of the Kubernetes cluster by adding a stub zone to my DNS servers. This requires changing the cluster.local domain to something that fits into my DNS namespace.</p>
<p>The cluster DNS is working fine with cluster.local. To change the domain I have modified the line with KUBELET_DNS_ARGS on /etc/systemd/system/kubelet.service.d/10-kubeadm.conf to read:</p>
<pre><code>Environment=&quot;KUBELET_DNS_ARGS=--cluster-dns=x.y.z --cluster-domain=cluster.mydomain.local --resolv-conf=/etc/resolv.conf.kubernetes&quot;
</code></pre>
<p>After restarting kubelet external names are resolvable but kubernetes name resolution failed.</p>
<p>I can see that kube-dns is still running with:</p>
<pre><code>/kube-dns --domain=cluster.local. --dns-port=10053 --config-dir=/kube-dns-config --v=2
</code></pre>
<p>The only place I was able to find cluster.local was within the pods yaml configuration which reads:</p>
<pre><code>  containers:
  - args:
    - --domain=cluster.local.
    - --dns-port=10053
    - --config-dir=/kube-dns-config
    - --v=2
</code></pre>
<p>After modifying the yaml and recreating the pod using</p>
<pre><code>kubectl replace --force -f kube-dns.yaml
</code></pre>
<p>I still see kube-dns gettings started with --domain=cluster.local.</p>
<p>What am I missing?</p>

<p>I had a similar problem where I have been porting a microservices based application to Kubernetes. Changing the internal DNS zone to cluster.local was going to be a fairly complex task that we didn't really want to deal with.</p>

<p>In our case, we <a href="https://coredns.io/2018/01/29/deploying-kubernetes-with-coredns-using-kubeadm/" rel="noreferrer">switched from KubeDNS to CoreDNS</a>, and simply enabled the <a href="https://coredns.io/plugins/rewrite" rel="noreferrer">coreDNS rewrite plugin</a> to translate our <code>our.internal.domain</code> to <code>ourNamespace.svc.cluster.local</code>. </p>

<p>After doing this, the corefile part of our CoreDNS configmap looks something like this:</p>

<pre><code>data:
  Corefile: |
    .:53 {
        errors
        health
        kubernetes cluster.local in-addr.arpa ip6.arpa {
          pods insecure
          upstream
          fallthrough in-addr.arpa ip6.arpa
        }
        prometheus :9153
        rewrite name substring our.internal.domain ourNamespace.svc.cluster.local
        proxy . /etc/resolv.conf
        cache 30

    }
</code></pre>

<p>This enables our kubernetes services to respond on both the default DNS zone and our own zone.</p>
