Home/Q&A/Can a remote Mac show which CDN node my site resolves to from the United States?

Can a remote Mac show which CDN node my site resolves to from the United States?

Updated · airankrush

Direct answer

Yes. In the remote Mac's terminal, dig shows the DNS answer and curl shows the response headers, and what you get is the real situation on this US residential broadband line. It is one vantage point and does not stand for the whole of the United States.

Basis

  • macOS ships with dig and curl; nothing extra to install. dig plus a domain returns the addresses it resolves to, and curl -sI plus a URL returns the response headers; most CDNs mark the code of the node that served the request and whether the cache was hit in those headers.
  • The answer depends on which resolver is used. scutil --dns shows the resolvers the machine is currently using; to compare against another public resolver, point dig at it temporarily with the @ argument, with no change to system settings.
  • The -w option of curl can print the time for name lookup, connection, first byte and total separately, which tells you which stage is slow more accurately than watching a browser progress bar.
  • traceroute shows the path to the node, which helps judge whether the request was routed to a faraway node.

Information as of .

Boundaries: when the answer is different

This is one vantage point on one residential broadband line. Routing may differ on other broadband providers and on cellular networks, and conclusions with statistical weight need a dedicated multi-point monitoring service. The broadband and exit may be shared with other machines, and timings are affected by line load at that moment, so measure several times at different times of day and do not conclude from a single result; we do not provide any speed or latency figures. Do not change the system's DNS or other network configuration to make comparisons; that is among the things you must not modify, and a mistake can take the machine offline. High-frequency probing or port scanning of sites that are not yours is a prohibited use; run the commands above against your own domains, and keep the frequency down.

How to do it

  1. Open Terminal and run scutil --dns to note the current resolvers.
  2. Run dig with your domain and record the returned addresses and TTL.
  3. Run curl -sI with the page URL and find the header fields that indicate the node and cache status.
  4. Print the per-stage timings with curl -w, and repeat a few times some hours apart.
  5. Save the command output together with the time it was run, and hand it to the colleague responsible for the CDN configuration to compare.

Use case

This question belongs to the use case: How can I test my site or app from a US network? Rent a real Mac in the United States

Other questions in the same use case:

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All Q&A