Bug 2009346

Summary: Podman name resolution not working as expected
Product: Red Hat Enterprise Linux 8 Reporter: pascal.ott
Component: podmanAssignee: Jindrich Novy <jnovy>
Status: CLOSED ERRATA QA Contact: Joy Pu <ypu>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.4CC: bbaude, dwalsh, jligon, jnovy, lsm5, mheon, pthomas, tsweeney, umohnani, ypu
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: podman-4.1.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-08 09:14:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description pascal.ott 2021-09-30 12:33:17 UTC
**Description**

the Bug is already [here](https://github.com/containers/podman/issues/11791) decribed.

When you have set a search domain in your hosts ```/etc/resolv.conf``` then the name resolution in podman container is failing, until you add the ```dns.podman``` search domain also to the ```/etc/resolv.conf``` of your host.

**Steps to reproduce the issue:**

1. add a search entry on your host to the ```/etc/resolv.conf``` file (example: search sample.domain)

2. start 2 container by using docker-compose without specifing explicit a network (dnsname plugin is installed)

3. from container01 try:
```
bash$ nslookup container02
```

4. from container01 try:
```
bash$ nslookup container02.dns.podman
```


**Describe the results you received:**
result from step 3:
```
Server:         10.89.0.1
Address:        10.89.0.1:53

** server can't find containername.sample.domain: NXDOMAIN
```

result from step 4:
```
Server:         10.89.0.1
Address:        10.89.0.1:53

Name:   container02.dns.podman
Address: 10.89.0.118
```

**Describe the results you expected:**
i want to use just the container-name for communication between containers. The search domain ```dns.podman``` should automatically added as first search domain in the ```/etc/resolv.conf``` of the container.

**Additional information you deem important (e.g. issue happens only occasionally):**
As work arround you can add ```dns.podman``` as search domain to your hosts ```/etc/resolv.conf```


**Package info (e.g. output of `dnf list podman*`):**

```
Installed Packages
podman.x86_64              3.2.3-0.11.module+el8.4.0+12050+ef972f71   @rhel-8-for-x86_64-appstream-rpms
podman-catatonit.x86_64    3.2.3-0.11.module+el8.4.0+12050+ef972f71   @rhel-8-for-x86_64-appstream-rpms
podman-docker.noarch       3.2.3-0.11.module+el8.4.0+12050+ef972f71   @rhel-8-for-x86_64-appstream-rpms
podman-plugins.x86_64      3.2.3-0.11.module+el8.4.0+12050+ef972f71   @rhel-8-for-x86_64-appstream-rpms
podman-remote.x86_64       3.2.3-0.11.module+el8.4.0+12050+ef972f71   @rhel-8-for-x86_64-appstream-rpms
```

Comment 1 Matthew Heon 2021-09-30 14:02:46 UTC
Cause is a too-old `dnsname` binary. We need to ensure `dnsname` 1.2 or newer is packaged for the next RHEL release (I think we're in 8.5.0.2 territory, now).

Assigning to Jindrich.

Comment 2 Jindrich Novy 2022-05-09 09:36:11 UTC
The current podman contains dnsname-1.3.0.

Can we get qa ack please?

Comment 5 Joy Pu 2022-05-16 08:30:13 UTC
Can reproduce with podman-3.2.3-0.10.module+el8.4.0+11989+6676f7ad.x86_64 the resolve.conf inside container look like this:
[root@sweetpig-18 ~]# podman exec con1 cat /etc/resolv.conf 
search sample.domain
nameserver 10.89.0.1
Test with podman-4.1.0-2.module+el8.7.0+15223+3987d347.x86_64 and its resolve.conf inside container already include dns.podman as expected. So set this to verified:
[root@sweetpig-9 ~]# podman exec con1 cat /etc/resolv.conf 
search dns.podman sample.domain
nameserver 10.89.0.1
nameserver 10.19.42.41
nameserver 10.11.5.19
nameserver 10.5.30.160

Comment 7 errata-xmlrpc 2022-11-08 09:14:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:7457