Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no localhost on /etc/hosts #11411

Closed
1995parham opened this issue Sep 2, 2021 · 8 comments · Fixed by #11445
Closed

There is no localhost on /etc/hosts #11411

1995parham opened this issue Sep 2, 2021 · 8 comments · Fixed by #11445
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@1995parham
Copy link
Contributor

/kind bug

I have setup rootless podman and after running a container everything works find but in the /etc/hosts/ I have the following content:

# Static table lookup for hostnames.
# See hosts(5) for details.
# used by slirp4netns
10.0.2.100      b932ec01d49e compassionate_visvesvaraya
10.0.2.2 host.containers.internal

but I think it should be:

# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1 localhost
# used by slirp4netns
10.0.2.100      b932ec01d49e compassionate_visvesvaraya
10.0.2.2 host.containers.internal

and because of that there is no resolution from localhost to 127.0.0.1.

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 2, 2021
@Luap99
Copy link
Member

Luap99 commented Sep 2, 2021

Can you share the commands you used?

@1995parham
Copy link
Contributor Author

1995parham commented Sep 2, 2021

sure, I used the following command:

podman run -ti --rm bash 

Also, I can share my configuration if it helps.

@Luap99
Copy link
Member

Luap99 commented Sep 2, 2021

What is in /etc/hosts on the host?

@1995parham
Copy link
Contributor Author

it is empty on my host but images by default has this, when I use no_hosts option I have localhost.

@Luap99
Copy link
Member

Luap99 commented Sep 2, 2021

Podman will use the the file from the host and then append the new entries, in your case for slirp4netns.
@mheon Should we add localhost if it does not exists in the host file, WDYT?

@mheon
Copy link
Member

mheon commented Sep 2, 2021

For slirp4netns and similar network modes, I would say yes.

For host networking, no, we should ensure that we exactly mirror the host system.

@1995parham
Copy link
Contributor Author

1995parham commented Sep 4, 2021

so if you agree I can make a PR for this.

@mheon
Copy link
Member

mheon commented Sep 4, 2021 via email

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants