Page 1 of 1

Substitute Domain name for ip address in .opvn file

Posted: Thu Jan 21, 2021 9:01 pm
by romans517
I am connecting to my home ip address. I have created a domain name via How do I connect via the domain name instead of my ip address which is likely to change? Is it as easy as editing the .opvn file making a substition?


Re: Substitute Domain name for ip address in .opvn file

Posted: Tue Mar 02, 2021 2:18 pm
by openvpn_inc
Hi There,

For OpenVPN Access Server, you could just configure that domain name in the Admin UI under Server Network Settings in the Hostname or IP address field. It is that field value that connection profiles generated and provisioned to the OpenVPN clients will be using to start a connection. So if this is set to your home dynamic IP address, then the connection profiles will try to connect to that dynamic IP address, in which you might encounter error connecting if your home IP is changed. The solution is to set up a proper domain name and configure that and save settings. Then uninstall, re-download, and reinstall the connection profile or OpenVPN Connect Client program and to try again.

And, yes it is also possible to change it directly on the connection profile (.ovpn). You can do so by getting the original .ovpn file from whereever you got it originally, and then open it in a text editor, and editing the line that starts with 'remote' to indicate where to connect. It could for example say:

Code: Select all

remote 1194 udp
You could then change it to:

Code: Select all

remote 1194 udp
And then import that profile into your OpenVPN Connect client program. It will then resolve to whatever your current IP address is, and then connect there.

There is also an option in the OpenVPN Connect client software itself to override the address it uses to connect to. If you tap the pencil icon next to the profile itself in the first page of OpenVPN Connect while you are disconnected, you can edit properties of this connection profile. One of them is named the server override (optional). Here you can put the address and then whenever you connect this profile, it will use that address to connect to your OpenVPN server instead of what's defined in the connection profile itself.

Kind regards,