OpenDNS URL Resolving Bookmarklet

As much as I love OpenDNS’ services, I find it a bit intrusive at times when URLs fail to resolve. For instance, sometimes my connection will mess up when visiting a page and it will ultimately result in a DNS hijacking.

Here’s a detailed example: Let’s say I visit this Reddit URL just as my connection flakes out:

http://www.reddit.com/r/programming/comments/a50gl/my_com_sci_professor_just_told_us_that_hes_never/

After a min or so of not resolving, OpenDNS kicks in and attempts to help out. It will convert that url to the following in the process:

http://guide.opendns.com/?url=www.reddit.com%2Fr%2Fprogramming%2Fcomments%2Fa50gl%2Fmy_com_sci_professor_just_told_us_that_hes_never%2F

Now I know that URL is valid, but now there’s no easy way to get back to it since the URL is all mangled. What can we do?

Javascript to the rescue! We simply use a bit of string manipulation on the url to figure out the original location and use the window.location style redirect to take us there. Simply drag this bookmarklet to your bookmarks bar to use. Here’s the relevant javascript code:

(function(){
	window.location = 'http://'+decodeURIComponent(document.location.search.substring(5));
})();

  • Joomla Development

    The post is written in very good manner and it entails many useful information for me. I am happy to find your distinguished way of writing the post.

  • i aslo like openDNS ....nice article for the peoples using java programing

blog comments powered by Disqus