# Service discovery and DNS overview

This topic describes how GKE on Azure interacts with Domain
Name Services (DNS).

## Service discovery

Service discovery is the process where workloads discover services without
knowing the service's IP address. This section describes how
GKE on Azure implements service discovery and managed DNS.

Kubernetes automatically generates service names that use the following
[specification](https://github.com/kubernetes/dns/blob/master/docs/specification.md):

`service.namespace.svc.cluster.local`

Where:

- `service`: your service's name
- `namespace`: your service's Namespace

Workloads also access external services--- for example `example.net`---
using DNS names. For more information on the behavior of DNS in Kubernetes, see
[DNS for Services and Pods](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/).

### CoreDNS

GKE on Azure uses
[CoreDNS](https://kubernetes.io/blog/2018/07/10/coredns-ga-for-kubernetes-cluster-dns/)
to resolve DNS names within clusters. CoreDNS runs as a redundant, scaled
[Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/)
in the `kube-system`
namespace. The CoreDNS deployment has a
[Service](https://docs.cloud.google.com/kubernetes-engine/docs/concepts/service.md.txt) that groups the CoreDNS Pods
and gives them a single IP address. The CoreDNS Deployment scales with the
cluster's size and usage.

### NodeLocal DNSCache

GKE on Azure uses
[NodeLocal DNSCache](https://kubernetes.io/docs/tasks/administer-cluster/nodelocaldns/)
to improve DNS lookup performance. NodeLocal DNSCache runs as a
[DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/)
on each node in your cluster. When a Pod makes a DNS request, the request first
goes to the DNS cache on the same node. If the cache can't resolve the DNS
request, the cache forwards the request to either:

- CoreDNS for an internal name--- for example `foo.bar.svc.cluster.local`

## What's next

- For an overview of how DNS is used in Kubernetes clusters, see [DNS for Services and Pods](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/).