Automatic DNS configuration for tun0 interface

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
stevecharter
OpenVpn Newbie
Posts: 1
Joined: Mon May 01, 2023 1:07 pm

Automatic DNS configuration for tun0 interface

Post by stevecharter » Mon May 01, 2023 1:17 pm

Hello.

I've been trying to set up leak-proof OpenVPN connection using NordVPN servers. I've been using NordVPNs UDP config simply running "sudo openvpn nordvpn.conf".

The issue I'm having is that once tun0 is setup and connection is established, I need to manually set NordVPN DNS servers for the tun0 interface. I'm using NetworkManager for this. Problem here is that I need to do this for every time I start a new ovpn connection. Additionally I need to take the connection down using nmcli, add the DNS and take it back up. If I just try to add the DNS, the routes on tun0 will disappear and I have to manually set them up.

I've noticed that upon starting OpenVPNs connection, it will receive the correct NordVPN DNS servers from a push reply, along the lines of:

Code: Select all

'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS 103.86.96.100,dhcp-option DNS 103.86.99.100
My questions:
1. Is there a way to permanently set DNS servers for the tun0 interface?
2. What does the push reply containing DNS servers do? Whats the effect of receiving this if its not automatically used?

Post Reply