Skip to content

Improve DNS handling? #600

Description

@DimitriPapadopoulos

Rationale

Setting DNS parameters has been raising different issues:

  • race condition between openfortivpn itself and pppd in earlier versions of openfortivpn prior to allow to use resolvconf instead of resolv.conf #486 and version 1.12.0
  • race condition between openfortivpn and NetworkManager (see for example Setting DNS parameters on Fedora #590)
  • mechanisms for setting DNS might be available at build-time but not run-time, or at run-time but not build-time (for example resolvectl from systemd is often available at run-time on Fedora machines but is not available at build-time by default)
  • mechanisms for setting DNS might be available but not working (for example resolvconf from systemd does not work as expected on Fedora as seen in openfortivpn 1.12 / DNS configuration problems #555)

Especially Fedora and CentOS have been challenging so far. Short of interacting with NetworkManager directly when NetworkManager is installed and used, I suspect the official way to modify DNS parameters on CentOS >= 8 and Fedora is running resolvectl which has been part of the systemd package since CentOS >= 8 (not CentOS 7 which is probably why busctl is used in #615).

Proposal for setting DNS parameters

Is it worth trying to further improve the DNS configuration mechanism when --set-dns=1? Perhaps using the following mechanisms and other ones you can think of?

  1. If NetworkManager is installed and in use (how to detect that?) interact with NetworkManager directly? Perhaps through nmcli?
  2. If resolvectl from systemd is available run it to modify DNS parameters.
  3. If resolvconf is available and works properly (either openresolv or resolvconf but not resolvectl), run it to modify DNS parameters.
  4. Fall back on modifying /etc/resolv.conf directly.

NetworkManager is a special case: I am not sure about supporting NetworkManager because NetworkManager already supports openfortivpn through NetworkManager-fortisslvpn. It's the other way round.

Documentation

Man pages:

Hopefully we can get some info from this bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=1815605

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions