systemd-resolve not apply settings based on network interface

I want to config systemd-resolve for working with different dns servers based on network interface. But when I create config un the /etc/systemd/network/tun.network nothing is happen.

  1. My tun.network file
[Match]
Name=tun

[Network]
DNS=10.1.1.1 10.1.1.2
Domains=~.mycorp
  1. Rebooting the systemd-resolve. service systemd-resolved restart

  2. Print resolvectl status

Link 3 (wlp9s0)
Current Scopes: DNS
     Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
   DNS Servers: 192.168.3.1
    DNS Domain: ~.

...

Link 16 (tun)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported

But I am waiting to see something like this:

Link 3 (tun)
   ...
   DNS Servers: 10.1.1.1 10.1.1.2
   DNS Domain: ~.mycorp

My question is how to properly config systemd-resolve for working with different dns servers based on network interface


Solution 1:

The problem is resolved. Thanks @iBug for his answer

After systemctl restart systemd-networkd dns servers appears in the output of resolvectl status