Support >
  About cybersecurity >
  If CDN origin pull fails, first check if DNS resolution is correct.
If CDN origin pull fails, first check if DNS resolution is correct.
Time : 2025-11-27 15:32:23
Edit : Jtti

  CDN origin pull failures are a common problem during website acceleration. Many website owners initially suspect CDN nodes, origin pull protocols, and origin server firewalls. However, in fact, over 60% of origin pull anomalies are related to DNS resolution errors. This is because the essence of CDN acceleration is that users access CDN nodes, which then send requests to the origin address. When the CDN's origin address resolution is incorrect, the record is misconfigured, the resolution times out, or the resolution points to an incorrect IP, all origin pull requests will fail, causing the origin server to be unable to return content, ultimately manifesting as 502, 503, 504 errors, or a direct timeout. Many sites forget to update DNS records after migrating servers, changing origin server IPs, replacing hosts, or modifying firewalls. The CDN nodes then obtain the old IP, naturally leading to access failures. Therefore, when troubleshooting CDN origin pull issues, it is crucial to first confirm whether the DNS configuration is correct; this is the fastest and most efficient way to locate the problem.

  DNS plays a vital role in CDN origin pulls. When a user accesses an accelerated domain, the CDN performs a DNS lookup based on the configured origin server domain. If the origin server is a domain name, the CDN node will resolve it in real time to obtain the origin server IP. If this record points to an old server, the resolution result is polluted, the record is misconfigured, or it is not synchronized to the global DNS cache, the CDN node will connect to the wrong address during the origin server lookup, causing the node to be unable to retrieve the origin server content. Even when the DNS resolution TTL is set too high, the CDN node may use the old cache, resulting in the situation of "always accessing the old server after migration". These seemingly occasional problems are essentially origin server anomalies caused by the DNS layer.

  When troubleshooting origin server failures, the first step is to use `dig` or `nslookup` to check if the local and authoritative DNS records are consistent. For example:

nslookup origin.example.com

  Alternatively, you can use `dig` to query the authoritative server:

dig origin.example.com +trace

  If the local query returns a different result than the authoritative one, it indicates a DNS cache delay, and the CDN node may also experience the same issue. If the query result points to an old IP or an unexpected address, the origin pull failure can almost immediately be attributed to a DNS configuration problem.

  Sometimes, users enter the main site domain name in the CDN console, but the main site points to the CDN or another accelerated domain name via a CNAME. This causes CDN origin pull requests to loop back to the CDN, creating an "origin pull dead loop." This configuration error often results in a 503 Service Temporarily Unavailable error. Therefore, the origin domain name must be the actual origin address and must not contain any CDN-layer CNAMEs. For example, the origin domain name should look like this:

origin.example.com

  Rather than:

www.example.com
cdn.example.com

  Any domain name managed by a CDN cannot be directly used as the origin pull domain; otherwise, it will lead to circular DNS resolution and origin pull interruption.

  Another common DNS problem causing origin pull failure is mismatched resolution types. For example, if the origin server is an IPv4 server, but the DNS resolution is configured as AAAA records, the CDN node will prioritize using IPv6 for origin pull, naturally resulting in failure. Alternatively, if the origin server is IPv6, but the CDN origin pull does not support IPv6, timeouts will also occur. Furthermore, some sites configure smart DNS for different regions, but smart resolution does not take effect for the CDN origin pull nodes, causing the CDN node to be resolved to the wrong regional server, thus failing to connect to the origin server.

  When initiating an origin pull, CDN nodes are affected by the DNS TTL. If the TTL is set too high (e.g., above 3600 seconds), even if you update the origin IP, the CDN node may still continue to access the old IP. Failure to reduce the TTL in time during website migration, new server IP changes, or origin server expansion is also a very common error. To ensure CDN nodes update the origin server IP quickly, it's recommended to adjust the TTL to 60 seconds or even 10 seconds before migration. This adjustment can usually be done in the DNS console.

  Origin server pull failures can also be related to DNS resolution order. If the origin server domain has multiple records (such as multiple A records or multiple CNAME records with different priorities), the CDN node might resolve to an IP with insufficient or unavailable resources, leading to connection failure. Some cloud service providers' DNS returns results randomly from the record list; if one of these IPs is invalid, CDN origin server pulls will experience intermittent failures.

  To more accurately pinpoint the problem, use curl to test whether the CDN node can directly access the origin server. Simulate an origin server pull request using the Host method:

curl -I http://Origin IP --header "Host: www.example.com"

  If curl can access the site normally, it indicates that the origin server itself is fine; the problem is most likely with DNS or CDN configuration. If curl fails to access the site at the origin level, you need to check the origin server's firewall, ports, and Nginx configuration.

  After migration, the origin server's firewall often blocks CDN node access. For example, the new server might have a security group enabled by default, but the CDN's origin IP address might not be whitelisted. Many users can access the site normally with only their local IP address open, but the CDN fails to access the origin server through global nodes due to blocked ports. Therefore, after checking DNS correctness, you must confirm that the origin server's ports are open to all CDN nodes.

  However, fundamentally, DNS issues should always be checked first. If DNS resolution is incorrect, the CDN cannot reach the origin server and will not be able to access the correct server. Regardless of whether a firewall is configured, an origin pull protocol is set, or HTTPS is enabled, if the target IP for DNS resolution is incorrect, all configurations will be ineffective.

  When using a CDN, you should also confirm that the CNAME record is resolved correctly. If a user directly resolves the A record to the origin IP without adding a CDN CNAME, the accelerated link will not work at all. Worse still, some sites enter an incorrect CDN address for the CNAME, causing the nodes to fail to recognize it and report an error. To ensure correct CNAME resolution, use:

nslookup www.example.com

  Confirm that the correct CDN domain name address is being returned. If the origin IP is still being returned, the DNS configuration is not effective, which will also lead to origin pull failures and acceleration anomalies.

  When using multiple CDNs in a mixed manner, implementing canary origin pulls, or deploying traffic in a distributed manner, DNS resolution strategies require even greater caution. When using multiple CDNs in a mixed manner, if different domain names are configured for the origin pull links, and the DNS points are not unified, some CDNs may pull the origin normally, while others may continuously fail, ultimately resulting in intermittent errors that are difficult to troubleshoot.

  To avoid origin pull failures, it is best to completely isolate the origin server's dedicated domain name from the front-end business. That is, the main site uses www.example.com, while the origin server uses origin.example.com, which should not be exposed to public internet users or accessed by search engine crawlers. The origin server domain name must remain unique, fixed, have a low TTL, and high stability so that the CDN can continuously and accurately pull the origin.

Pre-sales consultation
JTTI-Eom
JTTI-Defl
JTTI-Amano
JTTI-Jean
JTTI-Selina
JTTI-Ellis
JTTI-Coco
Technical Support
JTTI-Noc
Title
Email Address
Type
Sales Issues
Sales Issues
System Problems
After-sales problems
Complaints and Suggestions
Marketing Cooperation
Information
Code
Submit