In this tutorial, we will point your domain name to your Minecraft server using an SRV record. SRV records allow you to point the domain to an IP and Port number.
1. Login to cPanel and go to DOMAINS -> Zone Editor.
2. Click A Record
3. Enter minecraft for the hostname and your servers IP Address for the Address (Without the port). Once done, click ADD AN A RECORD.
4. Now you have created the A record, click Manage, then click Add Record > Add A SRV Record on the top right of the table.
5. Enter the following details:
Name: Name is the protocol/service followed by the subdomain. If you want to use play.example.com as your domain, enter _minecraft._tcp.play as the Name. If you want to just use example.com, then use _minecraft._tcp as the Name. (Rest of the domain will be auto-filled)
TTL: Use 14400
Priority: Use 0
Weight: Use 5
Port: Port number of your Minecraft server IP address.
Target: Insert minecraft.yourserver.com here (The A record you created previously - Change yourserver.com for your domain name)
6. Click Add Record once you have filled all the information for the SRV record.
ISPs and DNS providers cache DNS records. It can take up to 24 hours for your ISP/DNS Providers to update the SRV record and for it to start working for everyone.