Radar has landed - discover the latest DDoS attack trends. Get ahead, stay protected.Get the report
Under attack?

Products

Solutions

Resources

Partners

Why Gcore

  1. Home
  2. Developers
  3. What Are DNS CNAME Records? | How They Works, Use Cases, and Importance

What Are DNS CNAME Records? | How They Works, Use Cases, and Importance

  • By Gcore
  • July 25, 2023
  • 9 min read
What Are DNS CNAME Records? | How They Works, Use Cases, and Importance

CNAME records are an important tool in the world of business branding and website management that serve multiple purposes. For one, think of the subdomains “store.example.com” or “blog.example.com”—these represent distinct sections of a website that provide specific content types to visitors. Creating subdomains like “store” or “blog” is made possible by using CNAME records. Another use of CNAME records is to enable the use of content delivery networks (CDNs), which improve page load times and user experience. In this article, we will delve into how CNAME records work, explore their use cases, and learn best practices for implementing CNAME records.

What Is a CNAME Record?

CNAME, short for canonical name, is a type of DNS (Domain Name System) record. A CNAME record is used in two contexts:

  • To make a subdomain that directs to a different server
  • To send visitors from one domain to another

Let’s start with the first context. Imagine you have an online store and you want to create the subdomain “shop.example.com.” You can create a CNAME record to point to the main domain (example.com) or to a different source such as a third-party website using their provided URL. For instance, if you have a Shopify account, you can use a CNAME record (shop.example.com) to send your customers to your Shopify website (shops.myshopify.com).

In the second case, a CNAME record is used as a pointer or alias from one domain name to another. It allows you to associate one domain name with the IP address of another domain name. In simpler terms, a CNAME record is like a nickname or shortcut for a domain.

What Are the Components of a CNAME Record?

Here is a table with an example of a CNAME record:

HostnameRecord TypeValueTTL
www.example.comCNAME@ (example.com)1800 seconds
blog.example.comCNAMEblogalias.com3600 seconds
mail.example.comCNAMEdomainverify.googlehosted.com3600 seconds

Let’s examine each of these components and their functions in detail.

  • Hostname. The hostname is an identifier or a unique label to identify and differentiate devices within a network. In the Domain Name System (DNS), a hostname is commonly associated with a domain name. For example, in the domain name “www.example.com,” “www” is the hostname representing a specific server or service within the “example.com” domain. The hostname helps to route network requests to the appropriate device or server. Beyond websites, it can also be used to access resources such as email servers, FTP servers, or any other network-connected device.
  • Record type. The record type for CNAME records is always set to “CNAME” so that the DNS resolver can identify it as such. This allows the resolver to follow the alias and resolve the canonical name, retrieving the corresponding IP address or other server type.
  • Value. This represents the destination or target where the DNS resolver should redirect the queries for the specified hostname. For instance, if you need to verify your domain name in Google, you need to add a CNAME record with the unique value that they provide such as “domainverify.googlehosted.com.”
  • TTL (time to live). The TTL value for a CNAME record determines the length of time that DNS resolvers and caching servers should cache the record before checking for updates. It is specified in seconds. For example, a TTL of 3600 represents one hour of cache time.

Use Cases of CNAME Records

CNAME records provide flexibility in directing traffic, setting up subdomains, or implementing third-party services. Whether redirecting domains, managing content delivery networks (CDNs,) or facilitating email services, CNAME records empower website owners to customize and optimize their online presence, whatever their business type or size. Let’s look at some of the use cases of CNAME records in more depth.

Domain Redirection

CNAME records can redirect traffic from one domain to another, making it easy to switch between websites or redirect visitors to a different online location. When a CNAME record is created for a domain, it acts as an alias or nickname, allowing the source domain to point to the same IP address as the target domain.

Example: John’s Apparel, an online clothing retailer, decided to rebrand its website and switch to a new domain name, “new-johnsapparel.com.” To ensure a seamless transition, the company will set up a CNAME record for the old domain, “old-johnsapparel.com,” redirecting users to the new website. When users type “old-johnsapparel.com” into their web browsers, the CNAME record directs them to the new website. Users don’t need to learn or remember a new URL, which eliminates any potential loss of business when changing domain names.

Here’s a sample CNAME record for domain redirection:

TypeHostnameValue
CNAMEold-johnapparel.comnew-johnapparel.com

Subdomain Setup

CNAME records are frequently used to make subdomains that direct to separate servers or services. This helps organizations to arrange and handle specific parts of their website independently.

Example: ABC Corporation is a software development company with numerous services and departments. It wants to organize and manage its different services under specific subdomains. For instance, a subdomain “support.abc-corp.com” needs to be pointed to “support-target-server.com” for their customer support portal. This allows them to handle different parts of their business independently while maintaining an online presence with great UX.

Here’s an example CNAME record for subdomain setup:

TypeHostnameValue
CNAMEsupport.abc-corp.comsupport-target-server.com

Content Delivery Network (CDN)

CNAME records can be used to integrate CDNs, which cache and distribute website content across multiple servers, enhancing website performance and global accessibility.

Example: Shoes & More is an online store that sells a wide variety of footwear products and accessories to customers globally. They have experienced significant growth, resulting in high website traffic and the need to optimize their website’s performance and loading speed. The company decided to integrate a CDN to enhance its website’s performance. To achieve this, they signed up for a CND service and they were advised to set up a CNAME record.

Here’s an example CNAME record for content delivery network:

TypeHostnameValue
CNAMEshoesandmore.comcdn-provider-example.com

Email Service

CNAME records enable domain owners to configure email services from third-party providers. For instance, by creating a CNAME record you can associate your domain’s email subdomain (e.g., “mail.example.com”) with a dedicated email service provider like Google or Microsoft.

Example: Handmade Crafts & Treasures is a small e-commerce business that sells handmade crafts and artisanal goods online. They want to enhance their email communication by using a professional email service, so they decide to sign up for a third-party email service provider. To set it up, they need to create a CNAME record for the new email service.

Here’s an example CNAME record for email service:

TypeHostnameValue
CNAMEmail.handmadecrafts-treasures.commail.provider.com

Third-party service integration

By leveraging CNAME records, organizations can effortlessly integrate third-party services such as e-commerce platforms, customer support systems, or analytics tools, ensuring a seamless user experience. For instance, if you need to use Google Analytics for your website, you need to add a CNAME record to your DNS records to verify your domain name.

Example: XYZ Goods online store is an e-commerce business that sells a wide range of products through its website. They want to integrate Google Analytics to gain valuable insights into their website traffic and customer behavior. To achieve this, they need to add a CNAME record to their DNS records to verify their domain name for Google Analytics.

Here’s a CNAME Record for a third-party service (Google Analytics) integration:

TypeHostnameValue
CNAMEwww.xyz-goods-onlinestore.comanalytics.google.com

How Does DNS Manage and Resolve CNAME Records?

Managing and resolving CNAME records requires the use of DNS, which stands for the Domain Name System.

How DNS manages and resolves CNAME records

Here are the steps used by DNS to manage and resolve CNAME records:

  1. User sends a request. The process begins when a user sends a request, such as entering a website’s URL into their web browser.
  2. DNS resolver. The user’s device, typically operated by the internet service provider (ISP) or a public DNS provider, acts as the DNS resolver. The DNS resolver is responsible for handling DNS queries and resolving domain names into IP addresses.
  3. DNS root servers. If the DNS resolver does not have the requested information in its cache, it initiates a DNS query by sending a request to the root DNS servers. The root DNS servers are the starting point of the DNS resolution process and are responsible for providing information about the top-level domain (TLD) servers.
  4. TLD DNS server. The root DNS servers respond to the resolver’s query by providing the IP address of the TLD DNS server responsible for the specific TLD of the requested domain. For example, if the requested domain is “example.com,” the TLD DNS server for the “.com” TLD is identified.
  5. Authoritative DNS server. The DNS resolver contacts the TLD DNS server to obtain the IP address of the authoritative DNS server responsible for the domain “example.com.” The authoritative DNS server is where the specific DNS records, including CNAME records, for the domain are maintained. After that, the DNS resolver caches the obtained information, which helps in faster responses for subsequent queries and reduces the load on DNS infrastructure.

To summarize, DNS manages CNAME records by using resolvers to systematically query authoritative DNS servers, following any CNAME records encountered along the way, until the ultimate destination is reached. Caching improves efficiency and reduces the need for repeated queries.

Best Practices of Working with CNAME Records

Creating CNAME records requires thoughtful consideration to ensure a seamless experience and avoid potential issues—such as incorrect configurations of CNAME records—that can lead to downtime in online services. By following these five best practices, you can effectively manage your CNAME records and optimize your domain name setup.

#1 Identify The Purpose Of Your CNAME Record

Clearly define the purpose of the CNAME record; is it for domain redirection, subdomain setup, or integration with third-party services?

#2 Verify Record Compatibility

Once you know the purpose of the CNAME record you’re trying to set up, ensure that the CNAME records you create are compatible with your specific use case and the services you plan to integrate. For instance, if you’re integrating a CDN to your website, you should contact the CDN provider to obtain the correct CNAME value that you need in order to add to your CNAME record. It’s important to note that different services may have their own requirements and limitations when it comes to CNAME records, so it is highly recommended also to contact the support team of your DNS hosting provider for assistance.

#3 TTL Management

Time to live (TTL) is a value that indicates the lifespan of data in a network before it is removed. For effective TTL management, set an appropriate TTL value for the CNAME record. Consider the frequency of changes and the desired responsiveness. Lower TTL values result in quicker updates but may increase the DNS query load.

Example: When setting up a CDN, you need to enter the correct value provided by your CDN provider. This value determines how long DNS resolvers should keep the DNS records cached. Typically, the recommended TTL value for this is around 3600 seconds (1 hour,) which helps to balance caching efficiency and responsiveness.

#4 Avoid CNAME Chains

Minimizing the use of multiple CNAME records in a chain is recommended to avoid unnecessary latency and potential points of failure. Each additional CNAME lookup introduces delays in the DNS resolution process and increases the likelihood of encountering issues.

Example: Here is a CNAME chain consisting of three links. The chain begins with the subdomain “sales.example.com,” which directs to “marketing.example.com.” The “marketing.example.com” subdomain, in turn, directs to “promotions.example.com,” and finally, the “promotions.example.com” subdomain directs to “offers.example.com.”

TypeHostnameValue
CNAMEsales.example.commarketing.example.com
CNAMEmarketing.example.compromotions.example.com
CNAMEpromotions.example.comoffers.example.com

This usually happens when the website owner creates a new web page and also creates a new subdomain, then wants to redirect users to the new site. The process repeats itself again, and the website owner decides to create another one. As a result, it could cause excessive redirections that can lead to delays for the users.

#5 Perform Record Testing

To ensure that your CNAME record is working correctly, test its configuration and confirm it’s functioning as expected. You can do this by verifying that the record resolves accurately and redirects traffic to the intended destination. For example, after setting up a CNAME record, perform DNS lookups or utilize online DNS tools to verify the record’s accuracy.

What Are the Limitations of CNAME Records?

After understanding the different ways to use CNAME records on your website, it’s important to keep in mind the restrictions that come along with them. This next section will explore these limitations and their potential impact.

  • Limited direct use for the root domain. A significant drawback of CNAME records is that they cannot be utilized for the root domain (example.com.) Only subdomains (e.g., mail.example.com) can use CNAME records.
  • DNS resolution time may take longer. Due to the additional step in DNS lookup, it can lead to a slower website loading experience for users, especially for the first time they visit the website.
  • It can’t coexist with other DNS records. DNS rules prevent you from having both CNAME and other record types for the same subdomain. For instance, you can’t set up a CNAME for “mail.example.com” and also create an MX record with the same name.

For the latter situation, Gcore DNS provides the CNAME Flattening feature. But what exactly is CNAME flattening and how does it operate? Let’s delve into the details in the next section.

CNAME Flattening with Gcore

Gcore’s DNS service offers CNAME flattening to all our clients by default, regardless of their plan. CNAME flattening feature enables the use of CNAME records at the root domain. It accomplishes this by providing the IP address of the host during the lookup process, ensuring adherence to the DNS specifications.

TypeNameContentTTL
CNAMEblog.example.comexample.com3600 seconds
Table 1. Traditional CNAME record

The CNAME flattening feature helps avoid possible issues and makes the resolution process faster. Here’s an example:

TypeNameContentTTL
CNAMEexample.comexample.sitebuilder.com3600 seconds
Table 2. CNAME record with CNAME flattening

Our service also functions as an internal DNS cache that allows for CNAME flattening. This means that it resolves the chain of CNAME records and provides the IP address of the host, which can speed up DNS lookups and enhance your application’s performance.

How to Implement CNAME Flattening

To implement CNAME flattening, replace the previous A record for the domain root with the flattened CNAME record. For instance, suppose you have a domain, “example.com,” and you intend to use a CNAME record for the root domain to direct it to a third-party service that hosts your website, like “website-buildersite.com.”

Here’s how this might look without CNAME flattening:

TypeNameValue
CNAMEexample.comwebsite-buildersite.com

The CNAME record above doesn’t follow DNS standards, so it won’t function as intended. This is because CNAME records are not permitted at the root level. Now, let’s see how to use CNAME flattening to make it work properly.

First, remove A record before CNAME flattening is applied:

TypeNameContentTTL
Aexample.com192.168.0.13600 seconds

It is important to remove any existing A record and to ensure that there is only one record in the CNAME record set for the root domain. If there are multiple records in this set, CNAME flattening will not occur.

Next, create the CNAME record for the root domain “example.com” that points to the desired domain name:

TypeNameValueTTL
CNAMEexample.comwebsite-buildersite.com3600 seconds

That’s it, you’ve successfully implemented CNAME flattening!

Aside from CNAME flattening, Gcore DNS offers superior performance for managing your DNS. Our dedication to achieving minimal response times globally ensures that your applications load incredibly fast and without any issues.

Conclusion

CNAME records are crucial for delivering online services and are commonly used for subdomain redirection, CDN integration, email services, and analytics. However, using CNAME records at the root domain presents challenges. To overcome this, CNAME flattening can be employed, transforming CNAME records into A records for compatibility.

At Gcore, we offer CNAME flattening as a free feature in our DNS hosting service, allowing you to manage DNS records efficiently and ensure seamless operations for users. Whether you’re new to DNS or an experienced webmaster, our DNS hosting makes CNAME and other DNS record management easy and hassle-free. Reach out to our experts and we will be delighted to help you get started.

Related articles

What are captions and subtitles, and how do they work?

Subtitles and captions are essential to consuming video content today. But how do they work behind the scenes?Creating subtitles and captions involves a five-step process to ensure that your video’s spoken and auditory content is accurately and effectively conveyed. The five steps are transcription, correction, synchronization/spotting, translation, and simulation/display on screen.The whole process is usually managed using specialized subtitle or caption creator software.In this blog, we explain the five steps in more detail, what the end user sees, and how to choose the right caption/subtitle service for your needs.Step 1: TranscriptionSpoken content is transformed into a text-based format. Formats are different ways to implement the textual elements, depending on technical needs.Transcription creates the raw materials that will be refined in stages 2–4.Step 2: CorrectionCorrection enhances readability by improving the textual flow. Punctuation, grammar, and sentence structure are adjusted so that the user’s reading experience is seamless and doesn’t detract from the content.Step 3: Synchronization/spottingNext, the text and audio are aligned precisely. Each caption or subtitle’s timing is adjusted so it appears and disappears at the correct moment.Step 4: TranslationTranslation is required for content intended for consumption in multiple languages. During this stage, it’s important to consider format requirements and character limitations. For example, a caption that fits on two lines in English might require three in Spanish, and so in Spanish, one caption becomes two. As a result, additional synchronization might be necessary.Step 5: Simulation/display on screenFinally, the captions or subtitles need to be integrated onto the end user’s screen. Formatting issues might arise at this stage, requiring tweaks for an optimal user experience.How does the end user see subtitles and captions?After the technical process of creating captions and subtitles, the next step is understanding how these elements appear to the end user. The type of captions you choose can greatly impact the user experience, especially when considering accessibility, engagement, and clarity. Below, we break down the different options available and how they serve different viewing scenarios.Open captions: These are always visible to viewers and are a fixed part of the video. They’re popular, for example, for video installations in museums and employee training videos—cases where maximum accessibility is the key consideration when it comes to captions and/or subtitles.Closed captions: Viewers can turn these on or off based on preference. For instance, an online course might offer this feature, allowing learners to choose how to consume the content. Students could opt temporarily to turn on closed captions to note the spelling of a new term introduced during the course.Real-time captions: These are great for live events like webinars, where the text appears almost simultaneously as the words are spoken. They keep the audience engaged in real time without missing out on crucial points. For example, ambient noise like chatter in a sports bar might obscure commentary on a live TV basketball game. Real-time captions allow viewers to benefit from near-live commentary regardless of the bar’s noise levels or if the TV’s sound is muted.Burned-in subtitles: These are etched onto the video and cannot be turned off. A promotional video targeting a multilingual audience might use this feature so that everyone understands the message, regardless of their language preference.What to look for in captioning and subtitling servicesTo deliver high-quality captions and subtitles, it's important to choose a provider that offers key features for accuracy, efficiency, and audience engagement.Original language transcription: Accurate documentation of every spoken word in your video for unrivaled accuracy.Tailored translation: Localized content that integrates translations with cultural relevance, increasing resonance with diverse audiences.Alignment synchronization: Time-annotated subtitles, matching words perfectly to the on-screen action.Automatic SRT file generation: A simplified subtitling and captioning process through effortless file creation for a better user experience.Transform your videos with cutting-edge captions and subtitles from GcoreNo matter your video content needs, it’s essential to be aware of the best type of captions and subtitles for your audience’s needs. Choosing the right format ensures a smoother viewing experience, better accessibility, and stronger engagement across every platform.Gcore Video Streaming offers subtitles and closed captions to enhance users’ experience. Each feature within the subtitling and captioning toolkit is crafted to expand your video content’s reach and impact, catering to a multitude of use cases. Embedding captions is quick and easy, and AI-automated speech recognition also saves you time and money.Try Gcore's automated subtitle and caption solution for free

Why captions and subtitles are essential for video engagement

From TikToks on silent commutes to training videos in noisy offices, silent viewing is now standard. Captions and subtitles aren’t just accessibility features anymore. They’re essential for user engagement, global reach, and video performance.This article explores why captions and subtitles matter and how they boost engagement with your videos, providing a better user experience for your audience. If you want to know how captions and subtitles work, we’ve got an article for that too.How subtitles and captions improve your video performanceSubtitles are now widely used across platforms and age groups. For many younger viewers, reading along while watching is second nature, especially on social media. For others, subtitles are a practical solution: watching videos in public spaces, scrolling during breaks, or learning on the go—all without needing sound.Captions offer tangible benefits across four key areas:Engagement and comprehension: Improve clarity in movies, boost understanding in online courses, and increase focus in business content.Accessibility and inclusion: Make content available to hard-of-hearing users and break language barriers for global audiences.SEO and discoverability: Search engines can crawl subtitle text, making your video content more findable, even when autoplayed without sound.Silent usability: Your content works in all environments, from crowded trains to quiet offices.Captions have shifted from niche to norm, helping creators reach more people, boost retention, and deliver clearer messages.Common challenges and their solutionsImplementing captions at scale poses three major challenges: cost, delay, and accuracy. Here's why these challenges exist and how Gcore Video Streaming can help you overcome them at the click of a button.CostInvesting in high-quality transcriptions can be a financial burden, especially for smaller players in online education. Specialized expertise is required for accurate educational content, and human oversight adds ongoing labor costs. Transcription is a recurring expense that grows with multiple languages or regulatory compliance.Gcore scalable AI-powered transcription services reduce reliance on costly manual processes, offering affordable, multi-language support with built-in compliance features, making transcription cost-effective for all budgets.Delay/latencyIn live events, even slight delays in captioning can disengage audiences. For example, in a Formula One race, missing real-time commentary on pit stops or track conditions can leave viewers confused or frustrated. Lagging captions fail to keep pace with the action, breaking immersion.Real-time AI ASR (automatic speech recognition) from Gcore minimizes captioning delay, so that live captions sync perfectly with events, keeping viewers fully engaged without lag.AccuracyA small text error in captions can distort the message and harm reputation. Errors in MOOCs or corporate webinars risk undermining credibility and discouraging future participation. Precision is critical to maintain trust and clarity.Gcore leverages advanced AI models fine-tuned for domain-specific vocabulary and includes automated quality checks, drastically reducing errors and preserving message integrity across all video content.Enhance your video content with Gcore AI-powered caption and subtitles toolsCaptions are now a strategic content layer, not just an accessibility checkbox. With video now the dominant format across marketing, education, and entertainment, it's critical to implement captions efficiently, affordably, and at scale.Gcore’s AI-powered Video Streaming lets you generate accurate, real-time captions across multiple languages with minimal developer effort. Built-in AI ASR (automatic speech recognition) means your captions stay synchronized even during fast-paced live events. Whether you’re running an LMS, hosting global events, or publishing OTT content, Gcore Video Streaming helps you scale captions with speed and precision.Request a demo of Gcore AI ASR

How to cut egress costs and speed up delivery using Gcore CDN and Object Storage

If you’re serving static assets (images, videos, scripts, downloads) from object storage, you’re probably paying more than you need to, and your users may be waiting longer than they should.In this guide, we explain how to front your bucket with Gcore CDN to cache static assets, cut egress bandwidth costs, and get faster TTFB globally. We’ll walk through setup (public or private buckets), signed URL support, cache control best practices, debugging tips, and automation with the Gcore API or Terraform.Why bother?Serving directly from object storage hits your origin for every request and racks up egress charges. With a CDN in front, cached files are served from edge—faster for users, and cheaper for you.Lower TTFB, better UXWhen content is cached at the edge, it doesn’t have to travel across the planet to get to your user. Gcore CDN caches your assets at PoPs close to end users, so requests don’t hit origin unless necessary. Once cached, assets are delivered in a few milliseconds.Lower billsMost object storage providers charge $80–$120 per TB in egress fees. By fronting your storage with a CDN, you only pay egress once per edge location—then it’s all cache hits after that. If you’re using Gcore Storage and Gcore CDN, there’s zero egress fee between the two.Caching isn’t the only way you save. Gcore CDN can also compress eligible file types (like HTML, CSS, JavaScript, and JSON) on the fly, further shrinking bandwidth usage and speeding up file delivery—all without any changes to your storage setup.Less origin traffic and less data to transfer means smaller bills. And your storage bucket doesn’t get slammed under load during traffic spikes.Simple scaling, globallyThe CDN takes the hit, not your bucket. That means fewer rate-limit issues, smoother traffic spikes, and more reliable performance globally. Gcore CDN spans the globe, so you’re good whether your users are in Tokyo, Toronto, or Tel Aviv.Setup guide: Gcore CDN + Gcore Object StorageLet’s walk through configuring Gcore CDN to cache content from a storage bucket. This works with Gcore Object Storage and other S3-compatible services.Step 1: Prep your bucketPublic? Check files are publicly readable (via ACL or bucket policy).Private? Use Gcore’s AWS Signature V4 support—have your access key, secret, region, and bucket name ready.Gcore Object Storage URL format: https://<bucket-name>.<region>.cloud.gcore.lu/<object> Step 2: Create CDN resource (UI or API)In the Gcore Customer Portal:Go to CDN > Create CDN ResourceChoose "Accelerate and protect static assets"Set a CNAME (e.g. cdn.yoursite.com) if you want to use your domainConfigure origin:Public bucket: Choose None for authPrivate bucket: Choose AWS Signature V4, and enter credentialsChoose HTTPS as the origin protocolGcore will assign a *.gcdn.co domain. If you’re using a custom domain, add a CNAME: cdn.yoursite.com CNAME .gcdn.co Here’s how it works via Terraform: resource "gcore_cdn_resource" "cdn" { cname = "cdn.yoursite.com" origin_group_id = gcore_cdn_origingroup.origin.id origin_protocol = "HTTPS" } resource "gcore_cdn_origingroup" "origin" { name = "my-origin-group" origin { source = "mybucket.eu-west.cloud.gcore.lu" enabled = true } } Step 3: Set caching behaviorSet Cache-Control headers in your object metadata: Cache-Control: public, max-age=2592000 Too messy to handle in storage? Override cache logic in Gcore:Force TTLs by path or extensionIgnore or forward query strings in cache keyStrip cookies (if unnecessary for cache decisions)Pro tip: Use versioned file paths (/img/logo.v3.png) to bust cache safely.Secure access with signed URLsWant your assets to be private, but still edge-cacheable? Use Gcore’s Secure Token feature:Enable Secure Token in CDN settingsSet a secret keyGenerate time-limited tokens in your appPython example: import base64, hashlib, time secret = 'your_secret' path = '/videos/demo.mp4' expires = int(time.time()) + 3600 string = f"{expires}{path} {secret}" token = base64.urlsafe_b64encode(hashlib.md5(string.encode()).digest()).decode().strip('=') url = f"https://cdn.yoursite.com{path}?md5={token}&expires={expires}" Signed URLs are verified at the CDN edge. Invalid or expired? Blocked before origin is touched.Optional: Bind the token to an IP to prevent link sharing.Debug and cache tuneUse curl or browser devtools: curl -I https://cdn.yoursite.com/img/logo.png Look for:Cache: HIT or MISSCache-ControlX-Cached-SinceCache not working? Check for the following errors:Origin doesn’t return Cache-ControlCDN override TTL not appliedCache key includes query strings unintentionallyYou can trigger purges from the Gcore Customer Portal or automate them via the API using POST /cdn/purge. Choose one of three ways:Purge all: Clear the entire domain’s cache at once.Purge by URL: Target a specific full path (e.g., /images/logo.png).Purge by pattern: Target a set of files using a wildcard at the end of the pattern (e.g., /videos/*).Monitor and optimize at scaleAfter rollout:Watch origin bandwidth dropCheck hit ratio (aim for >90%)Audit latency (TTFB on HIT vs MISS)Consider logging using Gcore’s CDN logs uploader to analyze cache behavior, top requested paths, or cache churn rates.For maximum savings, combine Gcore Object Storage with Gcore CDN: egress traffic between them is 100% free. That means you can serve cached assets globally without paying a cent in bandwidth fees.Using external storage? You’ll still slash egress costs by caching at the edge and cutting direct origin traffic—but you’ll unlock the biggest savings when you stay inside the Gcore ecosystem.Save money and boost performance with GcoreStill serving assets direct from storage? You’re probably wasting money and compromising performance on the table. Front your bucket with Gcore CDN. Set smart cache headers or use overrides. Enable signed URLs if you need control. Monitor cache HITs and purge when needed. Automate the setup with Terraform. Done.Next steps:Create your CDN resourceUse private object storage with Signature V4Secure your CDN with signed URLsCreate a free CDN resource now

How do CDNs work?

Picture this: A visitor lands on your website excited to watch a video, buy an item, or explore your content. If your page loads too slowly, they may leave before it even loads completely. Every second matters when it comes to customer retention, engagement, and purchasing patterns.This is where a content delivery network (CDN) comes in, operating in the background to help end users access digital content quickly, securely, and without interruption. In this article, we’ll explain how a CDN works to optimize the delivery of websites, applications, media, and other online content, even during high-traffic spikes and cyberattacks. If you’re new to CDNs, you might want to check out our introductory article first.Key components of a CDNA CDN is a network of interconnected servers that work together to optimize content delivery. These servers communicate to guarantee that data reaches users as quickly and efficiently as possible. The core of a CDN consists of globally distributed edge servers, also known as points of presence (PoPs):Origin server: The central server where website data is stored. Content is distributed from the origin to other servers in the CDN to improve availability and performance.Points of presence (PoPs): A globally distributed network of edge servers. PoPs store cached content—pre-saved copies of web pages, images, videos, and other assets. By serving cached content from the nearest PoP to the user, the CDN reduces the distance data needs to travel, improving load times and minimizing strain on the origin server. The more PoPs a network has, the faster content is served globally.How a CDN delivers contentCDNs rely on edge servers to store content in a cache, enabling faster delivery to end users. The delivery process differs depending on whether the content is already cached or needs to be fetched from the origin server.A cache hit occurs when the requested content is already stored on a CDN’s edge server. Here’s the process:User requests content: When a user visits a website, their device sends a request to load the necessary content.Closest edge server responds: The CDN routes the request to the nearest edge server to the user, minimizing travel time.Content delivered: The edge server delivers the cached content directly to the user. This is faster because:The distance between the user and the server is shorter.The edge server has already optimized the content for delivery.What happens during a cache miss?A cache miss occurs when the requested content is not yet stored on the edge server. In this case, the CDN fetches the content from the origin server and then updates its cache:User requests content: The process begins when a user’s device sends a request to load website content.The closest server responds: As usual, the CDN routes the request to the nearest edge server.Request to the origin server: If the content isn’t cached, the CDN fetches it from the origin server, which houses the original website data. The edge server then delivers it to the user.Content cached on edge servers: After retrieving the content, the edge server stores a copy in its cache. This ensures that future requests for the same content can be delivered quickly without returning to the origin server.Do you need a CDN?Behind every fast, reliable website is a series of split-second processes working to optimize content delivery. A CDN caches content closer to users, balances traffic across multiple servers, and intelligently routes requests to deliver smooth performance. This reduces latency, prevents downtime, and strengthens security—all critical for businesses serving global audiences.Whether you’re running an e-commerce platform, a streaming service, or a high-traffic website, a CDN ensures your content is delivered quickly, securely, and without interruption, no matter where your users are or how much demand your site experiences.Take your website’s performance to the next level with Gcore CDN. Powered by a global network of over 180+ points of presence, our CDN enables lightning-fast content delivery, robust security, and unparalleled reliability. Don’t let slow load times or security risks hold you back. Contact our team today to learn how Gcore can elevate your online presence.Discover Gcore CDN

What is a CDN?

Whether you’re running an e-commerce store, streaming videos, or managing an app, delivering content quickly and reliably is essential to keeping users satisfied. This is where a content delivery network (CDN) comes into play. A CDN is a globally distributed network of servers that work together to deliver content to users quickly, minimizing latency. Instead of relying on a single server, a CDN uses edge servers—called points of presence (PoPs)—to cache or temporarily store copies of your content closer to the user. This optimizes website performance, drastically cuts down on load times, and improves the user experience. Research suggests that a one-second lag in page loading speed can significantly decrease engagement, citing a 7% decline in conversions and an 11% decrease in page visits. CDNs considerably speed up load times by reducing latency through content caching closer to the user. By splitting up your website’s traffic over several servers, CDNs also protect it from online threats. Distributed denial-of-service (DDoS) attacks are lessened by CDNs because they spread traffic among a network of servers, improving security and availability. What Challenges Do CDNs Address?CDNs tackle two key challenges to improve website and application performance: Slow load times: Users sometimes experience frustratingly slow-loading websites and applications. This is because data must travel from a server to the end user’s device, causing latency. CDNs move servers closer to end users, reducing the distance that data has to travel and speeding up load times.  High traffic volumes: High traffic volumes during peak times or cyberattacks can overwhelm your website and lead to latency or site unavailability. Since CDNs distribute traffic across multiple servers, no single server is overwhelmed. This helps prevent crashes and delivers smooth performance for all users.Common Use Cases for CDNsCDNs are vital across a range of industries, providing measurable improvements in content delivery and user experience. E-commerce websites use CDNs to guarantee quick page loading and frictionless shopping experiences, even during periods of high traffic. Speed is crucial for online businesses. A study found that the average cost of downtime for e-commerce websites is around $500,000 per hour. This includes lost sales, operational costs, and long-term damage to brand reputation Streaming services rely on CDNs to deliver high-quality video content while minimizing buffering. Netflix states that its CDN contributes to the daily delivery of over 125 million hours of streaming content, guaranteeing a seamless experience for customers worldwide. Gaming companies use CDNs to lower latency and provide a consistent real-time user experience, especially during live multiplayer matches, where it is essential to preserve an engaging and fair gameplay experience. News outlets and blogs benefit from CDNs by ensuring their content loads quickly for readers around the world, during large-scale traffic surges, especially during major events like elections or breaking news.  The Benefits of a CDNFaster Website PerformanceEvery second counts when delivering content online. Slow websites frustrate users and harm your business. CDNs speed up content delivery by caching data closer to users, reducing page and file load times. Whether you’re delivering static content (such as CSS, HTML or JPG files) or dynamic content (like data generated by user interactions or API calls), a CDN ensures optimal performance regardless of user location. While factors like DNS settings, server configurations, and code optimization all play a role, the physical distance between your origin server and your users is a factor that only a CDN can solve. Increased Availability and ReliabilityDowntime can seriously affect online businesses. Hardware failures, traffic surges, and cyberattacks can reduce your website’s availability, harming your customers’ experience and causing financial or reputational damage. In fact, around 98% of organizations report that just one hour of downtime costs over $100,000. A CDN ensures that your website remains available, fast, and reliable by leveraging essential features such as: Load balancing: This process dynamically distributes traffic across multiple servers to optimize performance and prevent overload.Intelligent failover: Automatically redirects traffic if a server goes offline, ensuring continuity with minimal disruption.Anycast routing: Directs users to the closest or most efficient server, further reducing latency and enhancing response times.Security FeaturesAs cyber threats continue to grow in sophistication and frequency, securing your website or application is more critical than ever. According to recent statistics from Cobalt’s 2024 Cybersecurity Report, weekly attacks worldwide increased by 8% in 2023, while attackers used more sophisticated strategies to exploit vulnerabilities. Strong security measures that not only safeguard your website but also guarantee optimal performance are necessary in light of these evolving threats. CDN security features not only improve website performance but also defend against a wide range of attacks by distributing traffic across multiple servers, which mitigates DDoS attacks and filters out malicious traffic before it reaches your website. These features, from DDoS protection to safeguarding APIs, help maintain uptime, protect sensitive data, and guarantee a seamless user experience. Most modern solutions like Gcore CDN integrate robust security measures into content delivery, such as:SSL/TLS encryption facilitates secure data transmission by encrypting traffic, protecting sensitive information from being intercepted.L3/L4 DDoS protection blocks large-scale cyberattacks designed to flood your network and disrupt services.L7 DDoS protection guards your website from more complex attacks targeting how the website functions, helping it continue to operate smoothly.Web application firewall (WAF) acts as a shield, blocking harmful traffic such as hacking attempts or malicious scripts before they can affect your site.API security protects the communication between your application and other software, preventing unauthorized access or data theft.Bot protection identifies harmful automated traffic (bots), preventing activities like data scraping or login attempts with stolen credentials while allowing useful bots (like search engine crawlers) to function normally. Elevate Your Online Experience With a CDNA CDN is no longer a luxury—it’s a necessity for businesses that want to deliver fast, reliable, and secure online experiences. Whether your goal is to optimize performance, manage high traffic, or protect your site from attacks, a well-configured CDN makes all the difference.Ready to enhance your website’s performance? Our futureproof CDN runs on a global network of over 180 points of presence, so your customers get outstanding performance no matter where in the world they’re located. Get in touch with our team today to learn how our CDN can benefit your business.Discover Gcore CDN

How to Migrate Your Video Files to Gcore Video Streaming

Migrating large volumes of video files from different platforms can be daunting and time-consuming, often discouraging companies from moving to a superior provider. But it doesn’t have to be this way. We’ve created this three-step guide to help you efficiently migrate your video files to Gcore from other popular streaming platforms.Step 1: Get Links to Your VideosFirst, obtain links to your videos and download them. Look for your provider in the list below, or refer to the general SFTP/S3 storage section if applicable. After completing the steps for your provider, go straight to step 2.Google DriveShare the file: Open Google Drive and locate the MP4 file you want to download. Right-click on the file and select “Share.”Get the shareable link: In the sharing settings, click “Get link.” Ensure the link-sharing option is turned on.Set sharing permissions: Adjust the sharing permissions so “Anyone with the link” can view or download the file. Copy the generated link.Amazon S3Edit S3 block public access settings: Go to the S3 management console, select the bucket containing your MP4 file, and edit the Block Public Access settings if necessary.Add a bucket policy: Implement a bucket policy that grants public read access to your files.Get the list of objects: Navigate to the Objects tab, find your MP4 file, and click on the file to obtain the Object URL, which will be your download link.VimeoAccess the video: Log in to your Vimeo account and go to the video you wish to download.Select options: Click on the “Settings” button (gear icon) below the video player.Get video file link: In the settings menu, go to the “Video File” tab, where you can find the download link for your MP4 file.MUXEnable master access: Log in to your MUX account, navigate to the video asset, and enable master access if it’s not already enabled.Retrieve URL to master: Once master access is enabled, the URL to the master file will be available in the video asset details. Copy this URL for downloading the file.DropboxCreate a shareable link: Log in to your Dropbox account and locate the MP4 file you want to share. Click on the “Share” button next to the file.Set access permissions: In the sharing settings, create a link and set the permissions to “Anyone with the link.” Copy the generated link to download the file.General SFTP or S3 StorageAccess storage: Log in to your SFTP or S3 storage service control panel.Manage buckets/directories: Navigate to the appropriate bucket or directory containing your MP4 files.Retrieve download links: Generate HTTP/S links for the files you want to download. You can then use these links to download the files directly.Step 2: Check Availability to DownloadEnsure that your video files are available and ready for download, preventing any interruptions or issues during the migration process.Open HTTP/S link in a browser: Copy the HTTP/S link for the MP4 file and paste it into your browser’s address bar. Press Enter to navigate to the link.Check the video plays correctly in the browser: Verify that the video starts playing once the link is opened. This step ensures that the file is accessible and the link is functioning properly.Right-click to download: While the video is playing, right-click on the video player. Select “Save video as…” from the context menu. Choose a destination on your local disk to save the MP4 file.Step 3: Upload to Gcore Video StreamingNo matter which provider you’re migrating from, you need to upload your videos to Gcore Video Streaming storage. There are three primary methods to upload videos to Gcore storage:Copy from external storage: If your videos are available via public HTTPS URLs, you can directly copy the video files from external storage to Gcore. This method efficiently transfers files without downloading them to your local device first.Upload from a local device: Videos can be uploaded from your local host, backend, browser, or mobile app using the TUS resumable upload protocol. This method is resilient to interruptions, ensuring a smooth upload process by resuming from the point of failure.Batch upload: This method will soon be available to migrate extensive collections of videos, allowing you to transfer vast numbers of video files efficiently.The simplest migration option is to obtain video URLs and copy them to Gcore Video Hosting, eliminating the need to download and reupload videos.Example API Request to Copy Video from External StorageTo copy a video from another server, specify the origin_url attribute in the POST API request. The original video will be downloaded for video hosting on our server. Here is an example of the API request to set a task for copying a video from external storage:curl -L 'https://api.gcore.com/streaming/videos/' \-H 'Content-Type: application/json' \-H 'Authorization: APIKey 1234$0d16599c' \-d '{ "video": { "name": "Gcore Demo", "description": "Video copied from an external S3 Storage", "origin_url": "https://s-ed1.cloud.gcore.lu/demo-video/gcore.mp4" } }Refer to the complete documentation for detailed steps and examples of API requests. The original file must be in MP4 format or one of the following formats: 3g2, 3gp, asf, avi, dif, dv, flv, f4v, m4v, mov, mp4, mpeg, mpg, mts, m2t, m2ts, qt, wmv, vob, mkv, ogv, webm, vob, ogg, mxf, quicktime, x-ms-wmv, mpeg-tts, vnd.dlna.mpeg-tts. Streaming formats like HLS (.m3u8/.ts) and DASH (.mpd/.m4v) are intended for final video distribution and cannot be used as original file formats. Here are examples of good and bad links:Good link: https://demo-files.gvideo.io/gcore.mp4Bad link (chunked HLS format): https://demo-files.gvideo.io/hls/master.m3u8Note: Currently, only one video can be uploaded per request, so transferring your library in batches will require automation.Migrate to Gcore Video Streaming TodayGcore Video Streaming makes video migration easy with support for multiple sources and automatic transcoding. Whether you’re moving files from cloud storage, hosting platforms, or API-based services, Gcore streamlines video administration. Store, process, and distribute videos in various formats, complete with features like subtitles and timeline previews.With seamless migration and automatic transcoding, Gcore ensures your videos are optimized and ready for distribution, saving you time and effort. Simplify your video management and ensure your content is always accessible and in the best format for your audience with Gcore’s robust video streaming solutions.

Subscribe to our newsletter

Get the latest industry trends, exclusive insights, and Gcore updates delivered straight to your inbox.