Please see more details about Kubernetes DNS Service (and dnsutils utility) in this page:
Kubernetes Cluster
Please see more details about Kubernetes Services in this page:
Services (services|svc)
Let's check the headless Service:
The previous provided the IP addresses of the Pods of the StatefullSet.
Let's resolve the fully qualified DNS names of the Pods:
Kubernetes constructs DNS sub-domains as follow: <POD-NAME>.<HEADLESS-SERVICE-NAME>.<NAMESPACE>.svc.cluster.local
The pods of the StatefulSet, as shown above, have the following fully qualified DNS names:
nginx-0.nginx.default.svc.cluster.local
nginx-1.nginx.default.svc.cluster.local