<p>I'm trying to register a new cluster-wide hosted zone, called <code>foo-bar.local</code> which points to the existing dns server. I figured for the host names to be resolved, I would be able to rewrite <code>myservice.namespace.foo-bar.local</code> to <code>myservice.namespace.cluster.svc.local</code> it would be able to resolve it. So I modified the <code>coredns-custom</code> configmap like this:</p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns-custom
  namespace: kube-system
data:
  my.server: |
    foo-bar.local:53 {
        errors
        rewrite name suffix .foo-bar.local. .svc.cluster.local.
        forward . /etc/resolv.conf
        cache 30
    }
</code></pre>

<p>In this case I'd expect the <code>rewrite</code> rule to happen before the request is forwarded to resolv.conf. I applied the config and deleted the coredns pods and verified it got picked up on the new instances, but when I try to do a <code>nslookup myservice.namespace.foo-bar.local</code> from a pod I get a <code>NXDOMAIN: Name does not resolve</code> error. Am I missing something? The reason I'm trying to create an "alias" suffix is so I can request TLS certificates matching a specific domain instead of <code>.svc.cluster.local</code>. Any help would be appreciated.</p>

<p>P.S. this is an AKS cluster, which doesn't seem to support configuring CoreDNS other than via the configmaps.</p>

Arian Motamedi
<p>Your request should go to <code>myservice.namespace.svc.foo-bar.local</code>. Not to <code>myservice.namespace.foo-bar.local</code>. </p>
