The CNAME setup feature in VergeCloud allows you to route traffic for a specific subdomain through VergeCloud’s CDN while keeping the existing Authoritative DNS settings. By using this feature, you gain enhanced control over subdomain traffic without requiring full domain DNS changes. This setup is especially useful when direct DNS changes are not possible, such as when serving applications for users of SaaS services.
The CNAME setup on VergeCloud is particularly beneficial for SaaS providers managing customer domains. Here are common scenarios:
First, log in to your VergeCloud account and register the subdomain where you want to apply CDN services.
After registering, add the subdomain's A, AAAA, or CNAME record in the DNS records.
In the VergeCloud Dashboard, navigate to the Traffic Transfer Type section and select "Upgrade to CNAME".
On the next screen, select Convert Domain Type. This will replace existing NS records with a CNAME record specific to your subdomain’s destination address.
After conversion, VergeCloud provides a unique CNAME destination record value for your subdomain. This value can be modified if necessary.
curl --location --request POST 'https://api.vergecloud.com/cdn/4.0/domains/example.com/cname-setup/convert' \
--header 'authority: api.vergecloud.com' \
--header 'accept: application/json, text/plain, */*' \
--header 'authorization: API KEY 1 2 3 4' \
--header 'cache-control: no-cache'
If you want all organizational domains to route traffic through VergeCloud, start by registering each domain in VergeCloud, activate them through CNAME, and then update their CNAME records to direct traffic to the primary domain, such as live.example.com. Next, create an A record that directs live.example.com to VergeCloud’s IPs.
Within the DNS provider settings for your primary domain, delete any previous records associated with the subdomain. Then, create a new CNAME record using the value from VergeCloud’s setup:
blog.example.com. 0 IN CNAME 802d64fa68594323a174bdea336ae4e5.cname.vergecloud.com.
Once the CNAME record is propagated across DNS servers, the subdomain’s status will change to "Active" within the VergeCloud panel. You can then issue an SSL certificate for the subdomain, provided by Let's Encrypt. The certificate is validated using HTTP-01 challenge. Follow VergeCloud’s SSL certificate guide for more details.
To ensure the CNAME setup is functioning correctly, follow these steps:
dig blog.example.com
to check if the CNAME resolves to the specified VergeCloud CDN address.curl -v https://blog.example.com
to confirm secure connections.https://blog.example.com
in a web browser to confirm that traffic is routed correctly through VergeCloud's CDN.