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

netclient: No support for DNS due to requiring modification of /etc/hosts #260817

Closed
purepani opened this issue Oct 13, 2023 · 7 comments
Closed
Labels
0.kind: bug Something is broken

Comments

@purepani
Copy link
Contributor

purepani commented Oct 13, 2023

Describe the bug

When using netclient with a netmaker server configured with DNS, the domains are unable to populate the /etc/hosts file, rendering the feature unable to be used. This happens because the hosts file is symlinked into the nix store, and as such cannot be modified.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Connect to a netmaker server with DNS enabled using netclient.
  2. Enable services.netclient and join the server.
  3. Check the journalctl logs for netclient to find issues modifying /etc/hosts due to being readonly.
  4. Try pinging one of the defined domains in netmaker, and see that the ping fails. However, when pinging the ip, it will succeed.

Expected behavior

Pinging the domain should succeed

Additional context

The service will likely need to be able to modify the hosts file dynamically in order to work correctly. I'm not sure what the solution would be in this case though.

Notify maintainers

@wexder

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
this path will be fetched (0.00 MiB download, 0.00 MiB unpacked):
  /nix/store/wfsbr2vjijkr5nax29y83vizz36ym34a-nix-info
copying path '/nix/store/wfsbr2vjijkr5nax29y83vizz36ym34a-nix-info' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.54-rt15, NixOS, 23.11 (Tapir), 23.11pre-git`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.0`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@purepani purepani added the 0.kind: bug Something is broken label Oct 13, 2023
@wexder
Copy link
Contributor

wexder commented Oct 30, 2023

@purepani oh I've not been using the dns so I didn't noticed this. I can reproduce it easily, however I'm not sure how I can fix it. Will give it a shot in next couple of weeks

@wexder
Copy link
Contributor

wexder commented Nov 27, 2023

@purepani I don't think there's anything we can do to allow netclient to write to /etc/hosts

@nazarewk
Copy link
Member

nazarewk commented Jan 26, 2024

I am pretty sure this can be closed now that Netmaker abandoned the idea of using hosts file: gravitl/netclient#655

I'm just not sure what should be configured instead.

@nazarewk
Copy link
Member

Current documentation suggests pointing your client machine to the CoreDNS' IP address. I have confirmed this with Netmaker developers on Discord.

@wexder
Copy link
Contributor

wexder commented Jan 26, 2024

@nazarewk thanks for finding this.

@nazarewk
Copy link
Member

nazarewk commented Jan 26, 2024

FYI: solved DNS completely server-side without any client-side config (wired up CoreDNS as NS record)
#283768 (comment)

@Iv4nS
Copy link

Iv4nS commented Apr 16, 2024

FYI: solved DNS completely server-side without any client-side config (wired up CoreDNS as NS record) #283768 (comment)

Hello there, would you be able to expand how or what did you do specifically?

I did 1, 2 and 3 from this: https://docs.netmaker.io/architecture.html#coredns

but where did you wire the NS record? an actual domain pointing (which one?) to the netmaker server public address or how?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

4 participants