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

[Feature]: split dns #2721

Open
1 task done
johan-smits opened this issue Dec 6, 2023 · 2 comments
Open
1 task done

[Feature]: split dns #2721

johan-smits opened this issue Dec 6, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@johan-smits
Copy link

Contact Details

johan.smits@leftclick.eu

What happened?

We run a split DNS setup. Once the connection is not established we need to use a public DNS to connect the to the nm gateway.
But then we can't use the internal dns.

It would be nice if we could use resolvectl like commands that can configure the dns for the internal domain once the connection is up and running?

The commands would be:

  • resolvectl dns netmaker 10.10.10.10 10.10.20.20
  • resolvectl domain netmaker myinternal.domain mysecondinternal.domain

Version

v0.21.2

What OS are you using?

Linux

Relevant log output

No response

Contributing guidelines

  • Yes, I did.
@johan-smits johan-smits added the bug Something isn't working label Dec 6, 2023
@johan-smits
Copy link
Author

In order to make it work I made an systemd service override:

### Editing /etc/systemd/system/netclient.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file

[Service]
ExecStartPost = bash -c "while ! ip addr show dev netmaker 2> /dev/null; do sleep 1; done"
ExecStartPost = sleep 1
ExecStartPost = resolvectl domain netmaker domain.com domain.net
ExecStartPost = resolvectl dns netmaker 10.10.10.10 10.10.20.20
ExecStartPost = resolvectl flush-caches

### Lines below this comment will be discarded

### /etc/systemd/system/netclient.service
# [Unit]
# Description=Netclient Daemon
...

It takes some time before the netmaker interface becomes available. That is why I need the bash while loop to hold it for some time.

It works but it feels not very solid. It would be nice if you can define some settings on the network like: domains and the resolvers for those. And once the connection it set-up it registers the desired settings.

@johan-smits
Copy link
Author

johan-smits commented Dec 13, 2023

One more addition, I ran into an issue that the netmaker interface was recreated (by netclient I guess) but it did not restart the service. So the DNS options that the service file set where gone and dns connection lost. One more reason for be that this can't be fixed by the systemd service file but it needs to be managed by the netclient after connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants