<p>I have a Kubernetes cluster. Some internal services (such as Kubernetes Dashboard) are only accessible via an OpenVPN instance I set up.</p>

<p>Per default kube-dns resolves services like: <code>http://{service-name}.{namespace-name}.svc.cluster.local</code></p>

<p>For example <a href="http://kubernetes-dashboard.default.svc.cluster.local" rel="nofollow noreferrer">http://kubernetes-dashboard.default.svc.cluster.local</a> works beautifully.
How can I add custom DNS entries to make these services for example accessible via <a href="http://kubernetes-dashboard.mycompany" rel="nofollow noreferrer">http://kubernetes-dashboard.mycompany</a> ?</p>

Hedge
<p>I'm not sure if this is possible with kubedns, but it is with coreDNS if you're on 1.11+.</p>

<p><a href="https://coredns.io/2017/05/08/custom-dns-entries-for-kubernetes/" rel="nofollow noreferrer">Custom DNS Entries For Kubernetes</a></p>

<p>If that's not an option you could run your own lightweight DNS service with your custom rules inside the cluster and set it up as a "stub domain" in the kubedns configMap as described <a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/#kube-dns" rel="nofollow noreferrer">here</a>.</p>

<pre><code>apiVersion: v1
kind: ConfigMap
  metadata:
    name: kube-dns
    namespace: kube-system
data:
  stubDomains: |
    {"dashboard.mycompany": ["1.2.3.4"]}
</code></pre>

<p>In this case you'd want to change <code>1.2.3.4</code> to the ClusterIP of your new DNS server.</p>
