<p>I work on a variety of different Kubernetes clusters in a variety of different clouds. My problem here is that it's difficult to discover what the FQDN for a kubernetes Service is as different clusters have different configurations.</p>

<p>Is there a way via <code>kubectl</code> to get the FQDN for a service? I don't see it when I use <code>kubectl describe svc</code>.</p>

<p>It should be something like <code>my-svc.my-namespace.svc.cluster-domain.example</code> according to this article:
<a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/</a></p>

<p>How do I figure out the <code>cluster-domain.example</code> part of the FQDN? I could just go with <code>my-svc.my-namespace.svc</code> and have it resolve, but I'd like to use the FQDN if I can.</p>

Breedly
<p>The cluster domain is defined in configMap named <code>coredns</code> in <code>kube-system</code> namespace. This configMap is the source of truth and used by coreDNS.In the below Configmap cluster domain is <code>cluster.local</code></p>

<pre><code>kubectl get cm coredns -n kube-system -o yaml
apiVersion: v1
data:
  Corefile: |
    .:53 {
        errors
        health {
           lameduck 5s
        }
        ready
        kubernetes cluster.local in-addr.arpa ip6.arpa {
           pods insecure
           fallthrough in-addr.arpa ip6.arpa
           ttl 30
        }
        prometheus :9153
        forward . /etc/resolv.conf
        cache 30
        loop
        reload
        loadbalance
    }
kind: ConfigMap
metadata:
  creationTimestamp: "2020-04-03T14:24:44Z"
  name: coredns
  namespace: kube-system
  resourceVersion: "177"
  selfLink: /api/v1/namespaces/kube-system/configmaps/coredns
  uid: d00d8e5d-d089-4d7a-a1d3-4460703c23d9
</code></pre>
