DNS resolving issues with NetworkManager and OpenVPN
I'm trying to figure out how to set up automatic DNS resolving for my work VPN connection, but I can't for the love of me figure out what is wrong.
I'm using NetworkManager in Gnome, so I just imported the ovpn file there, and was able to successully connect. I can connect to any address that is only accessible from the VPN, but DNS resolving does not work.
When I connect to the VPN, I can see the correct nameserver in /etc/resolv.conf, which is gone once I disconnect.
When running resolvectl, I also get the correct DNS address listed for Global and tun0:
Global
Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: foreign
Current DNS Server: 10.200.0.10
DNS Servers: 10.200.0.10 77.111.1.1 77.111.1.77
Fallback DNS Servers: 1.1.1.1 9.9.9.10 8.8.8.8 2606:4700:4700::1111 2620:fe::10 2001:4860:4860::8888
Link 2 (enp38s0)
Current Scopes: none
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Link 3 (wlo1)
Current Scopes: LLMNR/IPv4 LLMNR/IPv6
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Link 4 (docker0)
Current Scopes: none
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Link 12 (tun0)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 10.200.0.10
DNS Servers: 10.200.0.10
But, resolving those addressed doesn't work at all.. querying anything that should be available from the VPN using `resolvectl query service-name` just returns:
service-name: resolve call failed: 'service-name' not found
Does anyone have a clue what I'm missing? I would love to solve this via NetworkManager, as there are a couple of VPNs I need to connect to, and I want it to work for each of them. I don't want to hardcode any DNS addresses.
About this post
- Posted
- Archived
- Score
- 5 · 79% up
- Kind
- Text
- ID
- mgb121
8 comments
Did you enable systemd-resolved and symlink the /etc/resolv.conf file to the systemd-resolved stub file?
I think this is the right question!
See
man systemd-resolved, especially the "/ETC/RESOLV.CONF" section. Configure /etc/resolv.conf correctly (usually that means, to symlink it as documented).Dns resolution should already be automatic with network manager, regardless of whether you are on a vpn.
For what purpose are you manually trying to configure and access dns resolution?
I'm connecting to a kubernetes clusterr over VPN, so I can connect to some services that are exposed to it's network.
I'm not trying to manually configure it, I'm saying it's not working automatically, so I'm trying to figure out why..
Is this a new install? Have you ever had fully functioning network throughput at all before this business with the vpn?
Little info to understand. So just guessing.
recolvectl returns that systemd-resolved.service is not running. Are you directing NetworkManager to use the service? If so, have you triggered it? Have you configured NM to use it?
Assuming you go by graphical setting of the network, did you implement dhcp only? If yes change it to dhcp.
Are you by any chance using dhcpd.service? If yes, stop and disable it.
Give a feedback of any interventions or tuning you may have implemented. Otherwise we are not in a position to assist.
Deleted before we saved it.