Substitute Domain name for ip address in .opvn file

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
romans517
OpenVpn Newbie
Posts: 4
Joined: Thu Jan 07, 2021 1:49 am

Substitute Domain name for ip address in .opvn file

Post by romans517 » Thu Jan 21, 2021 9:01 pm

I am connecting to my home ip address. I have created a domain name via noip.com. 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?

thanks.

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 233
Joined: Tue Feb 16, 2021 10:41 am

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

Post by openvpn_inc » Tue Mar 02, 2021 2:18 pm

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 123.45.67.89 1194 udp
You could then change it to:

Code: Select all

remote myhostname.dyndns.org 1194 udp
And then import that profile into your OpenVPN Connect client program. It will then resolve myhostname.dyndns.org 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 myhostname.dyndns.org 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,
Crowley
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

Post Reply