systemd resolvectl drop in files for dns

My Setup

  • Ubuntu 20.04
  • dumb proprietary vpn client which changes /etc/resolv.conf

problem

  • each time any interface re-connect, NetworkManager come into play, redo resolv.conf

So far so good.

With resolvectl, I redo DNS settings for the vpn interface and it works fine until next interface re-connect.

# resolvectl dns tun0 10.10.10.10
# resolvectl domain tun0 "~example.com ~example.org"

How do I make it permanent?

I've try to created the file (and some other variations) without luck.

/etc/systemd/network# cat tun0.network 
[Match]
Name=tun0

[Network]
LLMNR=yes
MDNS=no
DNSSEC=no
SERVERS=10.10.10.10
DOMAINS=~example.com ~example.org 

I would like to know where to drop in files with specific configuration for each interface (vpn or not) for DNS settings.

More Context

My objective is to have a file where I can put VPN DNS configuration, for each time NetworkManager redo network configuration take into consideration the proprietary VPN DNS settings, in particularity, the split of resolving certain domains to certain DNS Servers.

Configuring it via resolvectl works as I expected, but it is "forgeted" each time NetworkManager redo network configuration.

I've other vpn connection managed via NetworkManager and it works fine. This vpn connection managed by a proprietary solution doesn't.

0
задан 9 August 2020 в 15:06

1 ответ

In the terminal, use nm-connection-editor, and create various VPN/regular connection profiles, with these settings...

enter image description here

enter image description here

1
ответ дан 11 August 2020 в 20:09

Другие вопросы по тегам:

Похожие вопросы: