Issue with services where intrapod communication is not working properly

When I was creating headless service in the cluster, node port and clusterip services are not working properly using clusterip & port and getting an error when using the same service for intrapod communication.
headless service
{ "kind": "Service", "apiVersion": "v1", "metadata": { "name": "cocostore", "namespace": "dev", "labels": { "name": "dev" } }, "spec": { "type": "ClusterIP", "clusterIP": "None", "selector": { "group": "dev" } } }
Nodeport service
{ "kind": "Service", "apiVersion": "v1", "metadata": { "name": "api-gateway", "namespace": "dev", "labels": { "name": "api-gateway" } }, "spec": { "ports": [{ "port": 8080, "nodePort": 31000 }], "type": "NodePort", "selector": { "service": "api-gateway" } } }
intrapod communication error
2020-01-23T09:59:29.128Z [EG:policy] warn: getaddrinfo EAI_AGAIN

Kubernetes version used 1.16.1
Can anyone help me to resolve this issue

Cluster information:

Kubernetes version: 1.16.1
Cloud being used: (put bare-metal if not on a public cloud)
Installation method: kubeadm init
Host OS: ubuntu 16.04
CNI and version: calico 3.9
CRI and version: