[Error] Unable to look up hostname with ns unshared.
- Dominant language
- Go
- Stars
- 13k
- Forks
- 541
- Avg merge
- 20h 47m
- Merged PRs (30d)
- 4
Description
**Describe the bug**
So I tried to run an application that requires running `hostname -i`, but with isolated network (bridge).
**To Reproduce**
Steps to reproduce the behavior
```bash
distrobox create -i archlinux --unshare-netns
distrobox enter archlinux -- hostname -i
```
**Expected behavior**
Show the ip address of the hostname immediately
**Logs**
```
~ via v25.9.0 via 🐍 v3.14.4 took 5s
❯ distrobox create -i archlinux --unshare-netns
Image archlinux not found.
Do you want to pull the image now? [Y/n]: y
Resolved "archlinux" as an alias (/etc/containers/registries.conf.d/00-shortnames.conf)
Trying to pull docker.io/library/archlinux:latest...
Getting image source signatures
Copying blob 1dd624a5d250 done |
Copying blob ab6ef42a20b3 done |
Copying config c26b5ec8ec done |
Writing manifest to image destination
c26b5ec8ec89a92d0189a76aa40a864b8c70f9a6feb1353c45b3d85981c3629f
Creating 'archlinux' using image archlinux [ OK ]
Distrobox 'archlinux' successfully created.
To enter, run:
distrobox enter archlinux
~ via v25.9.0 via 🐍 v3.14.4 took 31s
❯ distrobox enter archlinux -- hostname -i
wStarting container... [ OK ]
Installing basic packages... bu [ OK ]
Setting up devpts mounts... [ OK ]
Setting up read-only mounts... [ OK ]
Setting up read-write mounts... [ OK ]
Setting up host's sockets integration... [ OK ]
Integrating host's themes, icons, fonts... [ OK ]
Setting up distrobox profile... [ OK ]
Setting up sudo... [ OK ]
Setting up user's group list... [ OK ]
Setting up existing user - shell... [ OK ]
Setting up existing user - groups... [ OK ]
Ensuring user's access... [ OK ]
Container Setup Complete!
buhostname: gethostbyname: Unknown host
```
**Desktop (please complete the following information):**
- Are you using podman, docker or lilipod? docker
- Which version or podman, docker or lilipod? Docker version 29.4.1, build 055a478ea9
- Which version of distrobox? distrobox: 1.8.2.4
- Which host distribution? Arch
- How did you install distrobox? Pacman
**Additional context**
None
Contributor guide
Assessment
This issue has not been assessed yet.