title: CoreDNS suffix rewrite causes DNS queries to return the rewritten name
body: <p>I have a Kubernetes 1.13.1 cluster with CoreDNS and a number of services running in the default namespace that I'd like to be reachable via <code>&lt;servicename&gt;.nsc</code> in addition to the default <code>&lt;servicename&gt;.default.svc.cluster.local</code>.</p>
  
  <p>The first thing I've tried was manually rewriting each service, like this:</p>
  
  <pre><code>rewrite name gitea.nsc gitea.default.svc.cluster.local
  </code></pre>
  
  <p>Running <code>nslookup gitea.nsc</code> returns the expected output:</p>
  
  <pre><code>Server:     10.245.0.10
  Address:    10.245.0.10#53
  
  Name:   gitea.nsc
  Address: 10.245.64.203
  </code></pre>
  
  <p>I can <code>curl</code> it, all is fine.</p>
  
  <p>But then I tried abstracting this somewhat, as manually adding a line for each service is tedious.</p>
  
  <p>I ended up with this:</p>
  
  <pre><code>rewrite name suffix .nsc .default.svc.cluster.local
  </code></pre>
  
  <p>But now, <code>curl</code>ing suddenly fails. <code>nslookup</code> gives a possible clue as to why:</p>
  
  <pre><code>Server:     10.245.0.10
  Address:    10.245.0.10#53
  
  Name:   gitea.default.svc.cluster.local
  Address: 10.245.64.203
  </code></pre>
  
  <p>Now the name in the response contains the rewritten host, not the original input. My guess is that this throws off <code>ping</code>, <code>curl</code>, <code>wget</code>. </p>
  
  <p>My Corefile currently looks like this:</p>
  
  <pre><code>.:53 {
          errors
          health
          rewrite name git.nsc gitea.default.svc.cluster.local
          rewrite name suffix .nsc .default.svc.cluster.local
          kubernetes cluster.local in-addr.arpa ip6.arpa {
            pods insecure
            upstream
            fallthrough in-addr.arpa ip6.arpa
          }
          prometheus :9153
          proxy . /etc/resolv.conf
          cache 30
          loop
          reload
          loadbalance
      }
  </code></pre>
  
  <p>Everything apart from the two rewrite lines is autogenerated by my hosting provider. I'm using <code>git.nsc</code> in one case so I can have both rewrites in the Corefile simultaneously while I'm debugging this.</p>
  
  <p>I'm puzzled. How do I get CoreDNS to rewrite <code>&lt;servicename&gt;.nsc</code>, yet not return the rewritten host in its response?</p>