Score:1

systemd-resolve not apply settings based on network interface

ng flag

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

iBug avatar
tr flag
Perhaps you should restart systemd-networkd *as well*?
Score:1
ng flag

The problem is resolved. Thanks @iBug for his answer

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

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.