Skip to content

Allow for different options to set DNS

emelenas requested to merge emelenas/NetworkManager-fortisslvpn:DNS into main

Issue #33 refers to problems DNS setting by NetworkManager-fortisslvpn. According to the discussion there, the options chosen to open openfortivpn may not work in all cases since the intended behavior is not accomplished (at least, it did not for me nor for the original poster).

To address DNS handling after some modifictions to openfortivpn, NetworkManager-fortisslvpn was patched by https://gitlab.gnome.org/GNOME/NetworkManager-ortisslvpn/-/commit/66d431f18fd4812ed984790c877d965b35b69612 where --no-dns is always passed to openfortivpn and --pppd-use-peerdns=1 is passed if the user didn't ask to ignore peer DNS. The rationale behind that behavior is that it is best if NetworkManager addresses the DNS setup instead of openfortivpn writing directly to /etc/resolv.conf or using systemd-resolve. This task is implemented in the pppd-plugin that sends routes and DNS for NetworkManager to handle.

Now, apparently, this information can obtained from the server via the https response (handled by openfortivpn) and again by pppd (sent to NetworkManager via the plugin). The options used by NetworkManager-fortisslvpn, thus, has the disadvantage that the search domains are not set.

On the other hand, using openfortivpn directly correctly sets DNS and domain, apparently without writing to resolv.conf, since it is configured to use systemd-resolve, if present.

Now this issue can be addressed by providing three options to set DNS:

  • User settings (i.e., ignore all information coming from the peer)
  • pppd information, making use of the pppd plugin
  • server information coming with the http response, letting openfortivpn set the DNS information instead of sending it to NM

The present MR develops this options. Please note that there may be other way to pass the DNS information, specifically that coming in the http response, to NetworkManager but I have not explored them.

Edited by emelenas

Merge request reports