Firefox Whois Bookmark

So I was doing some experimentation with javascript and bookmarks in FireFox, and I came up with a nifty tool.

Let’s say you’re at a webpage, and you want to lookup the whois information on the domain. Normally, you open a new tab, open a whois engine, type or paste the domain name, and wait for the results.

With my bookmark, you just click the bookmark, and it opens up a whois search for the current page you are viewing.

It opens the bookmark in a new window (or tab if you have firefox set to open new windows in new tabs). It takes into consideration subdomains, and only looks up the root domain. It also takes international domains into consideration– like www.bbc.co.uk. In cases where the domain ends in co.anything, it appends the next segment of the url to the query to make sure you get the right results.

So, here is the code. Just create a new bookmark, and use this code for the URL:

javascript:URL=document.domain;arrURL=URL.split('.');lookup=arrURL[arrURL.length-2]+'.'+arrURL[arrURL.length-1];if (arrURL[arrURL.length-2]=='co') lookup=arrURL[arrURL.length-3]+'.'+lookup;win = window.open("", "Whois Search");void(win.location.href = 'http://whois.webhosting.info/'+lookup);

Enjoy!

Mike

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>