<p>I'm using podman 4.5-dev
I have two pods deployed using:
<em>podman kube play foo.yaml</em>
<em>podman kube play bar.yaml</em></p>
<p>I specified the pods' hostnames in the files, but they won't get resolved inside the containers.
I verified that the pods are in the same network.</p>
<p>Is there some DNS configuration missing? Should I use a Services? The official docs lack of a precise indication about this topic</p>
<p>Here's one of the two pods's YAML (the other one has the same keys with different values):</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
  labels:
    app: postgres
  name: postgres
spec:
  hostname: postgres
  containers:
  - name: pgadmin-container
    image: docker.io/dpage/pgadmin4:latest
    ports:
    - containerPort: 80
      hostPort: 9876
</code></pre>
<p>Here's some terminal output that could be useful:</p>
<pre class="lang-bash prettyprint-override"><code>[daniele@localhost]$ podman pod inspect xptssrv |grep -ni network
25:          &quot;HostNetwork&quot;: false,
34:          &quot;Networks&quot;: [
35:               &quot;podman-default-kube-network&quot;
37:          &quot;NetworkOptions&quot;: null,


[daniele@localhost]$ podman pod inspect postgres |grep -ni network
25:          &quot;HostNetwork&quot;: false,
34:          &quot;Networks&quot;: [
35:               &quot;podman-default-kube-network&quot;
37:          &quot;NetworkOptions&quot;: null,



[daniele@localhost]$ podman network inspect podman-default-kube-network |grep &quot;&quot; -n
1:[
2:     {
3:          &quot;name&quot;: &quot;podman-default-kube-network&quot;,
4:          &quot;id&quot;: &quot;a4dcf21f020ee4e36651c11256cbe884182552e835eaaafd409153cd21dca4cc&quot;,
5:          &quot;driver&quot;: &quot;bridge&quot;,
6:          &quot;network_interface&quot;: &quot;cni-podman1&quot;,
7:          &quot;created&quot;: &quot;2023-02-21T23:03:25.800256942+01:00&quot;,
8:          &quot;subnets&quot;: [
9:               {
10:                    &quot;subnet&quot;: &quot;10.89.0.0/24&quot;,
11:                    &quot;gateway&quot;: &quot;10.89.0.1&quot;
12:               }
13:          ],
14:          &quot;ipv6_enabled&quot;: false,
15:          &quot;internal&quot;: false,
16:          &quot;dns_enabled&quot;: false,
17:          &quot;ipam_options&quot;: {
18:               &quot;driver&quot;: &quot;host-local&quot;
19:          }
20:     }
21:]

[daniele@localhost pods]$ podman exec  xptssrv-xptssrv-container cat /etc/resolv.conf 
nameserver 192.168.1.6
nameserver 8.8.8.8

</code></pre>

<p>Edit your network settings in <code>/etc/containers/net.d/podman-default-kube-network.conflist</code>
Change this line</p>
<pre><code>&quot;dns_enabled&quot;: false,
</code></pre>
<p>To this:</p>
<pre><code>&quot;dns_enabled&quot;: true,
</code></pre>
<p>Then reboot and up your yaml and try to resolve this:</p>
<pre><code>postgres_pgadmin-container_1
</code></pre>
<p>Or maybe this:</p>
<pre><code>postgres_postgres_1
</code></pre>
<h2>Edit1</h2>
<p>Just copy the config file:</p>
<pre><code>sudo cp /usr/share/containers/containers.conf /etc/containers/containers.conf
</code></pre>
<p>Then in the file change the network backend to netavark using the following command:</p>
<pre><code>sed -i &quot;/^\s*\#*\s*network_backend\s*=.*$/ s/^.*$/network_backend = \&quot;netavark\&quot;/&quot; /etc/containers/containers.conf
</code></pre>
<p><strong>Notice:</strong> I think it's better to restart you system in order to apply changes.</p>
