There is a "bug" in Windows 10 and 11 where its DNS resolution uses the interface metrics assigned to it, and OpenVPN's network interface has too high of a metric to be used for DNS.
To fix it we'll lower the metric of the OpenVPN interface so it takes priority when you are connected to the VPN.
Identify The OpenVPN Interface Name
First open your Windows 10 Settings menu via the start menu -> Settings. Then click the "Network & Internet" tile:
From there go to the "Ethernet" tab on the left, then click "Change adapter options" under "Related Settings". This will open a window with all of your network adapters, similar to the below:
The next step is to locate which out of these interfaces is the OpenVPN adapter, it will be the one with the words "TAP-Windows Adapter" on the 3rd line (selected above). Make a note of the name of this adapter. In the above example it is "Local Area Connection 5", and we'll use that moving forward but substitute your own interface's name instead in the commands below as it is likely different.
Open An Admin Command Prompt
Press (windows key + x) and pick "Command Prompt (Admin)":
In the command window type in "netsh int ip show interfaces" which should present a list of all the interfaces:
The value we're looking for is "Met" (short for "Metric"). You can see our OpenVPN connection ("Local Area Connection 5") has a higher or same metric as other network connections. We need to set this metric value to a lower number than all the other interfaces.
In this case a value of 4 will be lower than all the other interfaces, so we'll use that. In the command window run the command "netsh int ip set interface "Local Area Connection 5" metric=25", substituting the OpenVPN interface you identified in the first step:
Note: You may see multiple OpenVPN interfaces such as "OpenVPN Data Offload", you will need to lower those connection metrics as well.
Lastly run the "netsh int ip show interfaces" command again and confirm that the OpenVPN interface(s) are the lowest "Met" value:
Reconnect to the VPN
Attempt to reconnect to the VPN and see if DNS resolution works now.