Wednesday 1 August 2012

Google Chrome net-internals, CDN hack using DNS overriding

Ever wondered how to check the URL through which videos are being streamed via flash objects or the URL through which your file is getting downloaded......Well it's easy with Google Chrome Browser.

Just go to the link chrome://net-internals/#sockets while the video is playing in the background and further click on "Flush socket pools" or "Close idle sockets" to get the exact URL you require.
See screenshot for YouTube server.


Now you may use this technique to edit your CDN server for better download speeds. A CDN is a content delivery server which delivers videos from sites like http://metacafe.com via a delivery partner like Akamai. The only interesting part is that the actual server is mostly located somewhere nearest to the user, possibly on his own network. Thus, he may get very high speeds without much contention.

But in some cases the DNS servers are not very effective in resolving the CDN host name to the best possible IP. Consider the case of metacafe on BSNL net connection. The site has a streaming URL of http://v.mccont.com which is actually supported by Akamai CDN.

But due to poor DNS management by BSNL the host name v.mccont.com resolves to an ip address of VSNL network instead of BSNL's own network. So sometimes I don't get the desired speeds due to contention.

Thus, we can bypass this drawback by using static DNS mappings for  hostnames like v.mccont.com.
Follow below steps to implement static DNS mapping in Windows.
1. Go to C:\Windows\System32\drivers\etc\ and locate the hosts file. Cut and Copy it to desktop and open it with notepad.
2. Add the following entries to the hosts file. General format is <ip> <domain>
----------------------------------------------------------------------------------------------------------

218.248.44.170 v.mccont.com
218.248.44.170 cdn.blinkx.com
218.248.44.170 av.vimeo.com
#210.212.11.18 cdn.blinkx.com
-----------------------------------------------------------------------------------------------------------

3. Now save it and again cut and copy it back to its original location.

The mapped ip addresses belong to BSNL's own network so negligible contention is expected.
# means that the line is commented or inactive.

cdn.blinkx.com belongs to http://blinkx.com and av.vimeo.com belongs to http://vimeo.com.
All are supported by Akamai CDN network.


1 comment:

  1. apply all that to break.com for a more challenging application

    extracting the FQDN is not sufficient

    ReplyDelete

clicksor