Fedora 33 - make DNS (systemd-resolved) working with NetworkManager's ForitSSL VPN connections

Published on Author admin

In Fedora 33 there is a systemd-resolved service enabled by default. Use following steps to make DSN working after establishing FortiSSL VPN connection using Network Manager (using NetworkManager-fortisslvpn-gnome plugin).

Assuming that "ppp0" is you virtual network interface for VPN connection, you can set X.X.X.X and Y.Y.Y.Y as DNS servers:

resolvectl dns ppp0 X.X.X.X Y.Y.Y.Y

Add domain name for this connection:

resolvectl domain ppp0 "exampledomainname.com"

Verify new settings by using:

# resolvectl status
Link 9 (ppp0)
      Current Scopes: DNS LLMNR/IPv4
DefaultRoute setting: yes          
       LLMNR setting: yes          
MulticastDNS setting: no            
  DNSOverTLS setting: no            
      DNSSEC setting: no            
    DNSSEC supported: no            
  Current DNS Server: X.X.X.X
         DNS Servers: X.X.X.X
                      Y.Y.Y.Y  
          DNS Domain: exampledomainname.com

To check whether DNS resolving is working and which network interface traffic will be routed by:

# resolvectl query google.pl
google.pl: 216.58.209.3                        -- link: wlp2s0
           2a00:1450:401b:807::2003            -- link: wlp2s0

-- Information acquired via protocol DNS in 846us.
-- Data is authenticated: no

To automate things up (establish FortiVPN connection and set DNS) you can use below script:
https://github.com/openterprise/scripts/blob/master/connectNetworkManagerFortiVPNsetDNS.sh