ancwrd1 / snx-rs

Open Source Linux Client For Check Point VPN Tunnels
GNU Affero General Public License v3.0
116 stars 8 forks source link

Use search domains instead of routing domains in resolvectl command #8

Closed nut-3 closed 9 months ago

nut-3 commented 9 months ago

Hi, this PR fixes two problem with assigning dns domains for vpn interface:

  1. At my company checkpoint returns dns servers with trailing whitespaces. Current snx-rs implementation pushes them to resolvectl in following format: DNS Domain: ~some.domain ~\032other.domain I modified deserialize for QuotedStringList to trim whitespaces from Vec members.
  2. systemd-resolved has two modes to serve DNS Domain: settings:
    • routing domains - records prefixed with ~. If resolved gets request to resolve domain with such suffix, it only forwards request to dns server of corresponding interface.
    • search domains - records not prefixed with ~. Such domains are also used to suffix single-label domain names. Like if resolved gets request git it can transform it to git.some.domain and resolve it's address. More detailed description is here

It's quite common to have single-label domain links in corporate systems, so using search domains seems logical hear. This PR removes addition of ~ in front of domain suffix. However if one wants to use routing domain, it can be achieved through --search-domains parameter usage.