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

Allow adding static names to hostresolver #622

Closed
jandubois opened this issue Feb 1, 2022 · 1 comment · Fixed by #650
Closed

Allow adding static names to hostresolver #622

jandubois opened this issue Feb 1, 2022 · 1 comment · Fixed by #650
Labels
enhancement New feature or request

Comments

@jandubois
Copy link
Member

The host resolver looks up names on the host, not inside the guest, so will not be able to resolve names from /etc/hosts inside the guest. This doesn't matter for programs running directly inside the guest, as they use the local resolver, and the host resolver is just a nameserver.

It does however affect containers, which only have access to the nameserver, so can't resolve e.g. host.lima.internal.

I suggest to add a configuration option:

hostResolver:
  hosts:
    "host.docker.internal": host
    "example.com": 127.0.0.1

The string host is special and will be translated to the gateway address to the host.

The name host.lima.internal is built-in and will always be defined as a name of the host.

@jandubois
Copy link
Member Author

We should also define the IP address of the hostname itself, i.e. the equivalent of

lima-default 192.168.5.15

systemd-resolved seems to do this automatically, but e.g. Alpine doesn't:

jan@lima-default:/Users/jan$ nslookup lima-default.
Server:		127.0.0.53
Address:	127.0.0.53#53

Name:	lima-default
Address: 192.168.5.15
Name:	lima-default
Address: fec0::5055:55ff:fee9:a1b4
Name:	lima-default
Address: fe80::5055:55ff:fee9:a1b4

lima-alpine:/Users/jan$ nslookup lima-alpine.
Server:		192.168.5.3
Address:	192.168.5.3:53

** server can't find lima-alpine.: NXDOMAIN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant