Obtain the real IP address of a CDN website

Source: Internet
Author: User
Tags servervariables

Many websites now use cdn technology. It is difficult to obtain the real IP address of their servers during some tests. I don't know what other good methods are available now, the following two types are available:
 
1: Find the real IP address from the CDN Server
Cache_peer 1.1.1.1 parent 80 0 no-query originserver
Cache_peer_domain 1.1.1.1 www.2cto.com

2: Check whether HTTP_X_FORWARDED_FOR is empty. If it is not empty, use this as the IP address; otherwise, obtain REMOTE_ADDR as the IP address.
If the server can upload files, add the following code to upload the files:
Request. ServerVariables ("LOCAL_ADDR") 'to get the Server IP Address
Request. ServerVariables ("REMOTE_ADDR") 'to obtain the Client IP Address/this may be a proxy
 
Request. ServerVariables ("HTTP_X_FORWARDED_FOR") 'to obtain the real IP address of the request Client
 
3: Check the second-level domain name.
 
You can refer to the only_guest method to find a foreign server to ping. Generally, the obtained result is a real IP address.
 

From websocket blog

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.