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

Unable to resolve hosts in /etc/hosts after upgrade #1200

Open
1 of 5 tasks
datocal opened this issue Nov 21, 2024 · 5 comments
Open
1 of 5 tasks

Unable to resolve hosts in /etc/hosts after upgrade #1200

datocal opened this issue Nov 21, 2024 · 5 comments

Comments

@datocal
Copy link

datocal commented Nov 21, 2024

Description

In Colima version 0.6.8 a container could resolve hosts defined in the host /etc/hosts

After upgrading to 0.8.0 this behaviour disappears. I'm not sure from which version this changes.

colima delete did not resolve the issue

Version

colima version 0.8.0
git commit: 9c08cff

runtime: docker
arch: x86_64
client: v24.0.6
server: v27.3.1
limactl version 1.0.1
qemu-img version 9.1.1
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers

Operating System

  • macOS Intel <= 13 (Ventura)
  • macOS Intel >= 14 (Sonoma)
  • Apple Silicon <= 13 (Ventura)
  • Apple Silicon >= 14 (Sonoma)
  • Linux

Output of colima status

INFO[0000] colima is running using QEMU
INFO[0000] arch: x86_64
INFO[0000] runtime: docker
INFO[0000] mountType: 9p
INFO[0000] socket: unix:///Users/david.tourino/.colima/default/docker.sock

Reproduction Steps

  1. Add a host on /etc/hosts like
    127.0.0.1 tests-hosts.test
  2. Start colima with colima start
  3. Run a curl from a container docker run alpine/curl tests-hosts.test
  4. Output says it can't resolve host
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: tests-hosts.test

Expected behaviour

Host is resolved, like in previous versions

Additional context

The Macbook is the M1 PRO, several colleagues face the same issue.

@abiosoft
Copy link
Owner

Thanks for reporting.

@abiosoft
Copy link
Owner

In the meantime, you can start colima with --dns-host flag.

colima start --dns-host tests-hosts.test=127.0.0.1

@sylvainmouquet
Copy link

The network is broken with version 0.8

sudo apt-get update
Ign:1 https://download.docker.com/linux/ubuntu noble InRelease         
Ign:2 http://ports.ubuntu.com/ubuntu-ports noble InRelease             
Ign:3 http://ports.ubuntu.com/ubuntu-ports noble-updates InRelease     
Ign:1 https://download.docker.com/linux/ubuntu noble InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports noble-backports InRelease
Ign:5 http://ports.ubuntu.com/ubuntu-ports noble-security InRelease
Ign:1 https://download.docker.com/linux/ubuntu noble InRelease
Ign:2 http://ports.ubuntu.com/ubuntu-ports noble InRelease
Ign:3 http://ports.ubuntu.com/ubuntu-ports noble-updates InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports noble-backports InRelease
Err:1 https://download.docker.com/linux/ubuntu noble InRelease
  Could not resolve 'download.docker.com'
Ign:5 http://ports.ubuntu.com/ubuntu-ports noble-security InRelease
Ign:2 http://ports.ubuntu.com/ubuntu-ports noble InRelease
Ign:3 http://ports.ubuntu.com/ubuntu-ports noble-updates InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports noble-backports InRelease
Ign:5 http://ports.ubuntu.com/ubuntu-ports noble-security InRelease
Err:2 http://ports.ubuntu.com/ubuntu-ports noble InRelease
  Could not resolve 'ports.ubuntu.com'
Err:3 http://ports.ubuntu.com/ubuntu-ports noble-updates InRelease
  Could not resolve 'ports.ubuntu.com'
Err:4 http://ports.ubuntu.com/ubuntu-ports noble-backports InRelease
  Could not resolve 'ports.ubuntu.com'
Err:5 http://ports.ubuntu.com/ubuntu-ports noble-security InRelease
  Could not resolve 'ports.ubuntu.com'
Reading package lists... Done
W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/noble/InRelease  Could not resolve 'download.docker.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/noble/InRelease  Could not resolve 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/noble-updates/InRelease  Could not resolve 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/noble-backports/InRelease  Could not resolve 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/noble-security/InRelease  Could not resolve 'ports.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

@sylvainmouquet
Copy link

and it works with colima start --network-address -t vz -c 3 -m 8 --vz-rosetta --verbose -f

@aegixx
Copy link

aegixx commented Nov 22, 2024

I was able to override by specifying DNS servers using --dns 1.1.1.1 --dns 1.0.0.1. When I looked at the /etc/resolv.conf, it specified a DNS server that was part of a network I logged into a couple days ago. Hopefully that helps someone track down the potential issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants