Hey everyone! I'm trying to figure out how to find out which CloudFront server I'm coming in from when accessing my static S3 site. I was considering using traceroute to get the information, but I'm not entirely sure if that's the best method. Also, is there a list of CloudFront servers by IP address that I can reference? Any help would be appreciated!
4 Answers
If you want to find the IP, try using the command `dig cloudfrontdomain.com`. That should give you the IP address, and then you can run a traceroute on that IP. Alternatively, you can also use `curl -I cloudfrontdomain.com` to check the headers directly.
Definitely look at the response header for the airport code; that indicates the POP location. If you're looking for an actual server name, though, that's tricky since you'll be going through a load balancer.
There’s a managed prefix list of IPs that CloudFront uses to connect to your origins. You can check it out here: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/LocationsOfEdgeServers.html for more details on the locations.
Check the response headers; you can usually find the POP airport code in there. This information is also available in the access logs. While traceroute can work, it's not the most reliable way to get this info, so I’d suggest using the headers instead.
Related Questions
Cloudflare Origin SSL Certificate Setup Guide
How To Effectively Monetize A Site With Ads