ancwrd1 / snx-rs

Open source Linux client for Checkpoint VPN tunnels
GNU Affero General Public License v3.0
57 stars 5 forks source link

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

Closed nut-3 closed 4 months ago

nut-3 commented 4 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.