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

dns: support for custom hosts #512

Merged
merged 2 commits into from
Dec 14, 2022

Conversation

FabianPonce
Copy link
Contributor

This PR adds support for passing host resolver information to Lima, allowing the internal DNS resolver to resolve any custom names you wish. This is particularly useful for services that do not use getaddrinfo, ie. specific nginx, envoy configurations.

@abiosoft
Copy link
Owner

Hi, thanks for this.

Rather than bringing the entire hostResolver config into Colima, I would recommend supporting config for only the custom hosts.

It can easily be an array flag e.g. --custom-host=host.docker.internal=host.lima.internal
And a config section for customHosts that is a map[string]string.

We would also need to keep host.docker.internal as default/base value and only append the user specified values.

@FabianPonce
Copy link
Contributor Author

I agree, I think that would be a much cleaner solution in general. I'll make some changes and re-request review.

@FabianPonce
Copy link
Contributor Author

@abiosoft I felt that the custom hosts functionality, being related to DNS, should live somewhere near the resolver settings, so I moved this under the network section. I'm happy to break it out into the originally suggested location if you still think that's more suitable.

I also renamed the DNS Resolvers list in the config struct to DNSResolvers to make that more clear in the code. I left the naming in the yaml alone as network.dns, though, to keep backwards compatibility for people using that.

@abiosoft abiosoft changed the title dns: support passing overridden hostresolver information to lima dns: support for custom hosts Dec 14, 2022
@abiosoft abiosoft merged commit 20ba5dd into abiosoft:main Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants