Manuel Alvarez

Testing on Akamai (Spoofing)

Blog Post created by Manuel Alvarez Employee on Jun 15, 2015

A common question I receive is how to test in Akamai Staging or how to test before CNAMEing to Akamai. The process consists on spoofing your host file to trick your computer into reaching an specific IP rather than resolve on DNS. This is how:

 

   a. Look up the IP address for the Akamai Edge Hostname using the ‘dig’ or ‘nslookup’ command as dig ***.edgekey.net (or edgesuite if you are not ding secure traffic). For example

            dig wwwsecure2.akamai.com.edgekey.net

            -  you can use an online tool if you are not familiar with command prompt. Check http://www.kloth.net/services/dig.php

            -  For testing in staging, replace the domain in step 1 to ***.edgekey-staging.net

 

    b. Put the IP  returned into your hosts file as ip.ip.ip.ip ***. For example

            172.233.15.98   www.akamai.com

            -  Repeat step ‘b’ for all the domains you want to spoof

            -  Windows: C:\WINDOWS\system32\drivers\etc\hosts

            -  Mac: /private/etc/hosts

 

    c. Save file (you might need admin rights)

            -  Note that if you are new to Akamai, you will need to wait until your Akamai configuration and edge hostname are ready for testing

 

    d. Restart browser and make requests for www.akamai.com

 

    e. Confirm you are testing in Staging. Akamai Staging servers include the HTTP response header X-Akamai-Staging as described on this article https://control.akamai.com/core/search/kb_article.search?articleId=4856 (log in required)

 

Testing Tools

Akamai provides several tools to help you get additional information about your site. These tools can be used to debug and troubleshoot your site on the Akamai network.  Please see the following link for more information: https://control.akamai.com/portal/content/akaServiceSupport/edgesuite/edgesuite_booster.jsp (log in required).


The link above contains information on how to add Akamai Pragma Headers on Firefox. For Chrome, check this video How to add Akamai Pragma Headers in Google Chrome. An useful and easy to use tool on Windows is Hosts File Editor - Home

 

Check this post from Damian Garbacz to get more information about what information you should be looking in the response headers https://community.akamai.com/community/web-performance/blog/2015/03/31/using-akamai-pragma-headers-to-investigate-or-troubleshoot-akamai-content-delivery

 

See also this article on the Luna Control Center (requires log in) https://control.akamai.com/core/search/kb_article.search?articleId=4644

 

China CDN Customers

Customers with China CDN must perform additional steps to obtain an Staging IP as explained at https://control.akamai.com/core/search/kb_article.search?articleId=4651 (log in required)

Outcomes