I'd like to understand how the priority of the dns servers works in the systemd resolve service.
For instance, when I connect to the VPN, I get the DNS servers associated with the tun0 interface (systemd-resolve --status):
Code:
Link 6 (tun0)
Current Scopes: DNS
DefaultRoute setting: yes
LLMNR setting: yes
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
Current DNS Server: 192.168.50.21
DNS Servers: 192.168.50.21
192.168.50.22
DNS Domain: company.local
And for my main wlan interface (facing the internet):
Code:
Link 2 (wlp0s20f3)
Current Scopes: DNS
DefaultRoute setting: yes
LLMNR setting: yes
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
Current DNS Server: 192.168.0.1
DNS Servers: 192.168.0.1
2a02:8109:a0c0:46c:10:18ff:febf:48dc
DNS Domain: ~.
In this scenario, 192.168.0.1 (from my own router) is being used.
This is what I get when I tell the vpn client to "use this connection only for resources on its network".
But when I uncheck this, so that all the traffic goes through the vpn, there's no DNS anymore for Link 2 (the internet facing interface):
Code:
Link 2 (wlp0s20f3)
Current Scopes: none
DefaultRoute setting: no
LLMNR setting: yes
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
The one from tun0 remains the same.
So how can I actually tell what dns server is currently (default) being used without turning to tcpdump, for instance?