I added my Peer-Config from Wireguard to Network Manager manually:
[Interface]
Address = 10.13.13.5
PrivateKey = key
ListenPort = 51820
DNS = 10.13.13.1, lan
[Peer]
PublicKey = key
Endpoint = domainname:51820
AllowedIPs = 0.0.0.0/0
I get a successfull connection from wireguard. But I found out, that the DNS from Wireguard is not used. I get a DNS-Leak.
When I check the status from wg0. I get:
Link 14 (wg0)
Current Scopes: DNS
DefaultRoute setting: yes
LLMNR setting: yes
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
Current DNS Server: 10.13.13.1
DNS Servers: 10.13.13.1
DNS Domain: lan
Wlan has:
Link 2 (wlp59s0)
Current Scopes: DNS
DefaultRoute setting: yes
LLMNR setting: yes
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
Current DNS Server: 172.20.10.1
DNS Servers: 172.20.10.1
DNS Domain: ~.
And when I check my DNS requests via dnsleaktest.com I see that my Ubuntu uses the DNS from WLan and not from the wireguard. I read about to change the DNS Domain from Wireguard to "~."
When I make the change then I get a result that my ubuntu uses both DNS requests from Wlan and Wireguard. But I could not find any solutions to use only the DNS over Wireguard.
I read from a post from 2019 that this was a bug in Network Manager from Ubuntu. We are now in 2022 and is this bug still there?
One more info:
When I use the same config over my Phone I have no DNS-Leaks.