Every Service gets a DNS name from the cluster's DNS server, CoreDNS, which runs in kube-system behind the kube-dns Service. The full form is SERVICE.NAMESPACE.svc.cluster.local.
Inside a Pod you rarely type all of it. The Pod's /etc/resolv.conf has a search path that starts with its own namespace, so a short name like cart finds the Service cart next to it. From another namespace the short name finds nothing; cart.shop or the full name works.
Most "the app can't reach the database" tickets come down to three things: the Service lives in another namespace than the caller expects, the name has a typo, or the Service exists but selects no Ready Pod. nslookup from a throwaway Pod separates the first two from the third, because a name that resolves proves the Service exists.
Resolve a name from another namespace, then read the search path.