I am using OpenVPN and have already set it up on a VPS server the, the client login page is accessible by the Ip of the server at port number :443 ie "0.0.0.0.0:443". I want it to be accessible to be accessible by a subdomain of my domain name eg "vpn.mydomain.com" but the problem is, I cant point port number when setting DNS records for my domain from my domain provider. How can I reconfigure it such that when a user enters "vpn.mydomain.com" to take him to 0.0.0.0:443 where the vpn is set at. Instead of the user having to manually enter the full ip address and port number. I am new to this stuff any answers would be really helpful
-
1Does this answer your question? [How to use DNS/Hostnames or Other ways to resolve to a specific IP:Port](https://serverfault.com/questions/74362/how-to-use-dns-hostnames-or-other-ways-to-resolve-to-a-specific-ipport) – Rob Jul 22 '22 at 11:46
1 Answers
AFAIK OpenVPN does not support SRV DNS records (nor any service discovery / auto-configuration method as far as I know). See the linked Q&A.
You can therefor only use DNS to associate a more easily remembered/entered/communicated hostname with an IP-address.
But worth an effort is to run your OpenVPN service on the default port. 1194 is the official IANA port number assignment for OpenVPN and should be the default OpenVPN uses if you don't define another port.
Often you can then omit the port number in the client configuration as well, as in many cases clients will default to using a default port number when you don't explicitly configure one. But you mileage may vary.
A bit how a web browser doesn't need the explicit port 443 and you can use https://serverfault.com
rather than https://serverfault.com:443
; when connecting to a TLS web site running on the default port, no explicit port number is required.
- 1,137
- 7