<p>I have two separate clusters (Application and DB) in the same namespace. Statefulset for DB cluster and Deployment for Application cluster. For internal communication I have configured a Headless Service. When I ping from a pod in application cluster to the service it works (Works the other way round too - DB pod to service works). But sometimes, for example if I continuously execute ping command for like 3 times, the third time it gives an error - <strong>&quot;ping: : Temporary failure in name resolution&quot;</strong>. Why is this happening?</p>

Dusty
<p>As far as I know this is usually a name resolution error and shows that your DNS server cannot resolve the domain names into their respective IP addresses. This can present a grave challenge as you will not be able to update, upgrade, or even install any software packages on your Linux system. Here I have listed few reasons</p>
<p><strong>1.Forgot configuring or Wrongly Configured resolv.conf File</strong></p>
<p>The /etc/resolv.conf file is the resolver configuration file in Linux systems. It contains the DNS entries that help your Linux system to resolve domain names into IP addresses.</p>
<p>If this file is not present or is there but you are still having the name resolution error, create one and append the Google public DNS server as <code>nameserver 8.8.8.8</code></p>
<p>Save the changes and restart the systemd-resolved service as shown.</p>
<p><code>$ sudo systemctl restart systemd-resolved.service</code></p>
<p>It’s also prudent to check the status of the resolver and ensure that it is active and running as expected:</p>
<p><code>$ sudo systemctl status systemd-resolved.service</code></p>
<p><strong>2. Due to Firewall Restrictions</strong></p>
<p>By some chance if the first solution did not work for you, firewall restrictions could be preventing you from successfully performing DNS queries. Check your firewall and confirm if port 53 (used for DNS – Domain Name Resolution ) and port 43 are open. If the ports are blocked, open them as follows:</p>
<p>For UFW firewall (Ubuntu / Debian and Mint)
To open ports 53 &amp; 43 on the UFW firewall run the commands below:</p>
<pre><code>$ sudo ufw allow 43/tcp
$ sudo ufw reload```
For firewalld (RHEL / CentOS / Fedora)
For Redhat based systems such as CentOS, invoke the commands below:

```$ sudo firewall-cmd --add-port=53/tcp --permanent
$ sudo firewall-cmd --add-port=43/tcp --permanent
$ sudo firewall-cmd --reload
</code></pre>
<p>I hope that you now have an idea about the ‘temporary failure in name resolution‘ error. I also found a similar git issue hope that helps</p>
<p><a href="https://github.com/kubernetes/kubernetes/issues/6667" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/6667</a></p>
