Gathering information for troubleshootin·续
Explanation of this timing output ↗︎ is found on the Cloudflare blog.
Note
As demonstrated in the preceding example, cleaner results are achieved by denoting a new line with \n before each variable. Otherwise, all metrics are displayed together on a single line.
Caching
curl helps review the HTTP response headers that influence caching. In particular, review several HTTP headers when troubleshooting Cloudflare caching:
- CF-Cache-Status
- Cache-Control/Pragma
- Expires
- Last-Modified
- s-maxage
Note
You can refer to the Cloudflare Cache documentation for more details.
SSL/TLS certificates
Reviewing Certificates with curl
The following curl command shows the SSL certificate served by Cloudflare during an HTTPS request (replace www.example.com with your hostname):
curl -svo /dev/null https://www.example.com/ 2>&1 | egrep -v "^{.*$|^}.*$|^* http.*$"
Note
2\*>&1 | egrep -v "^{.*$|^}.*$|^\* http.\*$" \* cleans and parses the TLS handshake and certificate information.
To display the origin certificate (assuming one is installed), replace 203.0.113.34 below with the actual IP address of your origin web server and replace www.example.com with your domain and hostname:
curl -svo /dev/null https://www.example.com --connect-to ::203.0.113.34 2>&1 | egrep -v "^{.*$|^}.*$|^* http.*$"
Testing TLS Versions
If troubleshooting browser support or confirming what TLS versions are supported, curl allows you to test a specific TLS version by adding the --tlsv1.X ↗︎ and --tls-max ↗︎ options to your curl:
--tlsv1.0 --tls-max 1.0--tlsv1.1 --tls-max 1.1--tlsv1.2 --tls-max 1.2--tlsv1.3 --tls-max 1.3
Temporarily pause Cloudflare
When to use
Use this when you need to quickly determine if an issue is caused by Cloudflare or your origin server. Pausing Cloudflare routes traffic directly to your origin, bypassing Cloudflare's proxy.
For more details, refer to Pause Cloudflare.
Network troubleshooting
These tools help diagnose network-level issues such as routing problems, packet loss, and connection failures between your location and Cloudflare or your origin server.
Perform a traceroute
When to use
Use traceroute when you experience connection timeouts, slow connections, or need to identify where in the network path an issue occurs. This shows each hop between your device and the destination.
Traceroute is a network diagnostic tool that measures the route latency of packets across a network. Most operating systems support the traceroute command. If you experience connectivity issues with your Cloudflare-proxied website and ask Cloudflare Support for assistance, ensure to provide output from a traceroute.
Note
Timeouts are possible for ping results because Cloudflare limits ping requests.
Review the instructions below for running traceroute on different operating systems. Replace www.example.com with your domain and hostname in the examples below:
Run traceroute on Windows
- Open the Start menu.
- Click Run.
- To open the command line interface, type cmd and then click OK.
- At the command line prompt, type:
For IPv4 -
tracert www.example.com
For IPv6 -
tracert -6 www.example.com
- Press Enter.
- You can copy the results to save in a file or paste in another program.
Run traceroute on Linux
- Open a terminal window.
- At the command line prompt, type:
For IPv4 -
traceroute www.example.com
For IPv6 -
traceroute -6 www.example.com
- You can copy the results to save in a file or paste in another program.
Run traceroute on Mac OS
- Open the Network Utility application.
- Click the Traceroute tab.
- Type the domain or IP address in the appropriate input field and press Trace.
- You can copy the results to save in a file or paste in another program.
Alternatively, follow the same Linux traceroute instructions above when using the Mac OS terminal program.
Add the CF-RAY header to your logs
When to use
Use this when you need to correlate specific requests with Cloudflare's logs for troubleshooting. The CF-RAY header uniquely identifies each request through Cloudflare's network and is essential for Support investigations.
The CF-RAY header traces a website request through Cloudflare's network. Provide the CF-RAY of a web request to Cloudflare support when troubleshooting an issue. You can also add CF-RAY to your logs by editing your origin web server configuration with the snippet below that corresponds to your brand of web server:
If a request fails with a connection timeout and returns no CF-RAY header, the request most likely never reached Cloudflare's network. This pattern can point to an ISP blocking traffic to specific Cloudflare IP addresses. For more information, refer to Potential ISP blocking of Cloudflare IP addresses.
For Apache web servers, add %{CF-Ray}i to LogFormat
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %{CF-Ray}i" cf_custom
For Nginx web servers, add '$http_cf_ray' to log_format
log_format cf_custom '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" '
'$http_cf_ray';
Correlate a Ray ID with a packet capture
A packet capture records the connection at the packet level. The Ray ID identifies one request within that connection. Provide both so that Support can match the frames in your capture to the request that was slow or failed.
- Start the packet capture before you reproduce the issue. Leave it running.
- Reproduce the request that is slow or failing. Record its Ray ID from the
cf-rayresponse header. On a Cloudflare error page, the Ray ID also appears at the bottom. If you log the CF-RAY header at your origin, you can take it from your logs instead. - Record the time of the request in UTC. Read it from the same host that runs the capture, so that both share a clock.
- Stop the capture and save the file.
- Attach the capture to your support ticket with the Ray ID and the UTC time.
Note
Ray IDs are not guaranteed to be unique. Two different requests can share one. Always send the UTC time window with the Ray ID so that Support can tell the requests apart. For more information, refer to Cloudflare Ray ID.
Perform a MTR
When to use
Use MTR when you need more detailed network diagnostics than traceroute provides. MTR combines traceroute and ping to show real-time latency and packet loss at each hop, making it easier to identify intermittent network issues.
My Traceroute (MTR) is a tool ↗︎ that combines traceroute and ping to measure a network path's health, which is another common method for testing network connectivity and speed. In addition to the hops along the network path, MTR shows constantly updating information about the latency and packet loss along the route to the destination. This helps in troubleshooting network issues by allowing you to see what's happening along the path in real-time.
MTR works by discovering the network path in a similar manner to traceroute, and then regularly sending packets to continue collecting information to provide an updated view into the network’s health and speed.
Like traceroute, MTR can use ICMP or UDP for outgoing packets but relies on ICMP for return (Type 11: Time Exceeded) packets.
Note
For MacOS users, MTR can be installed through homebrew ↗︎. For Windows users, see WinMTR ↗︎.
How do I use MTR to generate network path report?
Using MTR on NIX based machines
Generally, we'd use MTR as the following:
mtr -rw <dest_hostname> e.g.: mtr -rw one.one.one.one
or with destination IP:
mtr -rw <dest_IP> e.g.: mtr -rw 1.1.1.1
with TCP port
mtr -P <tcp port> -T <destination ip>
Please refer to this documentation, which explains more about analysing MTR: How to read MTR ↗︎.
Run Packet Captures
When to use
Use packet captures when you experience connection resets, packet loss, SSL handshake failures, or HTTP errors like 520, 524, and 525. These issues occur at layers 3/4 and don't appear in HTTP logs, requiring deep packet-level analysis.
Issues that happen at the layers 3/4 occur before requests reaching Cloudflare's logging system, so they do not show up in the HTTP logs. Therefore, troubleshooting issues related to connection resets, packet loss or SSL handshake failures can be tricky without a deep investigation at the packet level.
Some HTTP errors generated by Cloudflare, such as 520s, 524s and 525s, show underlying issues at layers 3/4, and might require a packet capture for further investigation.
How to Run a Packet Capture
Caution
Please be aware, if you transmit any sensitive information while a packet capture is running, it will be recorded.
Cloudflare suggests Wireshark ↗︎ for running packet captures. For instructions on how to use the tcpdump command line, refer to this ↗︎ article.
- Close all programs/browser tabs that could be sending data in the background to avoid having to use a lot of display filters later.
- Create your Wireshark capture filter (refer to this ↗︎ article for more information).
- Select the appropriate interface (e.g. Wi-Fi: en0). If you're not sure which interface to use, Wireshark provides an I/O graph of each interface to give you a hint.
- Click the blue shark fin icon in the top left-hand corner to start your packet capture.
- Reproduce the issue while running capture.
- Click the red square icon in the top left-hand corner to stop your packet capture.
- Save as a
.pcapfile and attach it to your support ticket.
Note
To match a capture to a specific request rather than to the connection as a whole, also record the request's Ray ID and the UTC time. Refer to Correlate a Ray ID with a packet capture.
Related resources
- Contacting Cloudflare Support
- Cloudflare HTTP 5XX errors
- Diagnosing network issues with MTR and traceroute ↗︎
- cURL command line tool ↗︎
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/support/troubleshooting/general-troubleshooting/gathering-information-for-troubleshooting-sites/#page","headline":"Gathering information for troubleshooting sites","description":"Collect diagnostic data for Cloudflare support tickets.","url":"https://developers.cloudflare.com/support/troubleshooting/general-troubleshooting/gathering-information-for-troubleshooting-sites/","inLanguage":"en","image":"https://developers.cloudflare.com/support/troubleshooting/general-troubleshooting/gathering-information-for-troubleshooting-sites/og.png?v=9365c8130b724b70","dateModified":"2026-10-23","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Understand anycast routing to non-local data centers. title: Cloudflare traffic not being sent to the geographically closest data center image: https://developers.cloudflare.com/support/troubleshooting/general-troubleshooting/geographic-traffic-routing/og.png?v=f178434cc78d153f
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/support/llms.txt
Use this file to discover all available pages before exploring further.
Docs