-
Notifications
You must be signed in to change notification settings - Fork 321
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
split DNS #561
Comments
I guess the FortiGate device is not properly configured: as far as I can see it provides incorrect DNS server information. Note that FortiClient on Windows might be using IPSec, not VPN SSL. As far as I can see they are configured differently on the FortiGate device:
|
Hi,
I was actually mistaken, and probably misleading, in thinking that the log message in my original post was about split DNS. Now I see it belongs to the "main" DNS settings, and zeroes mean leave system DNS as it is. openfortivpn behaves correctly in this regard. I searched the logs at max verbosity for hints about my local DNSs, and found nothing apart from the XML dump of
n.b. traffic to the local DNS servers is enabled in the rules and routes are being set correctly. My conclusion is that openfortivpn does not currently support split DNS. |
Ah, since I don't own a FortiGate appliance myself I am not aware of all options. Indeed the current code only parses:
It looks like we should also parse:
|
Unfortunately, it's more complex. We also have to manipulate the process of DNS resolution then, and send the requests for those domains to the appropriate servers whereas requests for all other domains shall still be sent to the system DNS servers. |
I don't know openfortivpn's internals, but from what I gather I suspected that it would not be easy. |
Fedora 33 is expected to switch to systemd-resolved which might (or not?) help configuring split DNS. |
this could help, yes, but we are still left with the tasks
|
According to the FortiClient Administration Guide support for split DNS has been introduced in FortiClient 6.0.3:
|
Please do not make openfortivpn, or support of split dns in openfortivpn, require systemd. |
Some Linux systems do not support systemd but yes, systemd and NetworkManager should be used when available. There is already at least one ticket about that. |
That may be true for Windows and probably MacOS for latest versions. openfortivpn as it is now - and as it supposedly will ever be - relies on the rest of the stack to do DNS resolution. What can be done is make openfortivpn interact with something that will take care of split DNS. One option is to use systemd-resolved, but there are others, e.g. dnsmasq, see this link. Also look at the link at the start of that article, NetworkManager has a dnsmasq plugin (disclaimer: I just found out about it). |
An interesting article about "split DNS" has been published on Fedora magazine: |
Unfortunately it focuses on systemd-resolved while most desktop distributions use NetworkManager. I still fail to find an overview explaining the different subsystems related to name resolution, how they interact, what API they offer to programmers, what to expect on major Linux platforms such as Debian, Ubuntu, RHEL or Fedora (desktop and server versions as they may differ). Of course I'm not saying systemd-resolved is not a step in the right direction, just that name resolution in the current Linux ecosystem is fragmented and complex. |
Sadly, that is completely accurate. History suggests that systemd will "solve" this issue, possibly in a way that will piss off many. |
Split-dns seems to be quite a complicated thing to implement correctly, and probably depends on something like systemd-resolvd or NetworkManager support to be added, as discussed here: adrienverge#561 In the mean time DNS is not working at all if no global dns is set. This patch implements a slightly ugly workaround by using the split-dns info as the default dns when no default dns was configured in the xml response. I expect that the two settings are mutually exclusive in any case, but I don't understand DNS well enough to be sure.
Split-dns seems to be quite a complicated thing to implement correctly, and probably depends on something like systemd-resolvd or NetworkManager support to be added, as discussed here: adrienverge#561 In the mean time DNS is not working at all if no global dns is set. This patch implements a slightly ugly workaround by using the split-dns info as the default dns when no default dns was configured in the xml response. I expect that the two settings are mutually exclusive in any case, but I don't understand DNS well enough to be sure.
I don't think any VPN software should bother to implement this. You just need to support the same interface as for example OpenVPN to call a helper that sorts this out. But I think there is only madness in trying to do this yourself. And with all the known issues with resolv.conf (hence all the existing workarounds) I also don't think breaking that is a good default behavior at all. (Except perhaps on some *BSD) |
My idea would be to move to vpnc-scripts to handle routing and DNS, but I won't have time to implement that in the foreseeable future (see #600 and #678). |
Looks like I am not getting DNSs from my SSL VPN.
I get this on the logs:
INFO: Got addresses: [10.10.10.1], ns [0.0.0.0, 0.0.0.0]
Split DNS works fine accessing the same profile from Forticlient/Win.
I am running 1.12.0 but the same happened on 1.11.0.
Gateway runs FortiOS 6.2.3 but the same happened on 6.0.7.
The text was updated successfully, but these errors were encountered: