Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I understand that you would like to know if we can use the DNS name of the VPN Gateway instead of the Public IP to connect to it.
Yes, you can go ahead.
As long as the OnPrem Device supports FQDN, there should not be any issue.
Kindly let us know if this helps or you need further assistance on this issue.
Thanks,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.