PiVPN DNS Name
I have used PiVPN for many projects over the past few years. It makes setting up a VPN gateway really easy and now supports Wireguard as well as OpenVPN. I have started using it more often since they added the ability for it to be installed on a vanilla Ubuntu installation, it no longer needs to be run on a Raspberry Pi.
One of the problems I have come across a few time with PiVPN is when the public IP address of DNS name of the VPN gateway changes. The VPN configuration file still have the original IP or DNS name. Originally I just manually updated each configuration file to the new address but this gets frustrating very quickly.
I found the solution in the Github Issues. There’s a default config header file that you can edit and this is included in the top of all new configuration files. Simply edit this file to match the new IP or DNS name and you’re good to go.
/etc/openvpn/easy-rsa/pki/Default.txt
This is also the place to add additional parameters to the configuration files such as route-nopull to prevent the VPN server from forcing its routes on the remote user. This makes split tunnel configurations easier.