Skip to content

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.

5 points8 comments
Open on Reddit
About this post
Posted
Archived
Score
5 · 79% up
Kind
Text
ID
mgb121

Author

10
posts
36
comments
5
media
View profile

8 comments

Did you enable systemd-resolved and symlink the /etc/resolv.conf file to the systemd-resolved stub file?

2 points

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).

2 points

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?

1 points

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..

1 points

Is this a new install? Have you ever had fully functioning network throughput at all before this business with the vpn?

1 points

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.

1 points
unknown author

Deleted before we saved it.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.