dns = {};
(function($, undefined) {
    
    // Having a standard json call here will be a lot more secure.
    var baseUrl = 'http://dig.jsondns.org/IN/';
    var dataType = 'jsonp';

    dns.query = function(nameToResolve, field, callback) {
        if (callback === undefined) {
            callback = field;
            field = 'A';
        }
        
        var url = baseUrl + nameToResolve + '/' + field;
        
        $.ajax({ url: url, dataType: dataType, success: callback });
    };
    
    dns.queryReverse = function(ip, callback) {
        var ipv4 = ip.match(/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/);

        if (ipv4 === null) return;
        
        ipv4.shift();
        ipv4.reverse();
        var nameToResolve = ipv4.join('.') + '.in-addr.arpa';
        
        dns.query(nameToResolve, 'PTR', function(data) {
            if (data === undefined || data.answer === undefined || data.answer.rdata === undefined) {
                callback(undefined);
            } else {
                callback(data.answer.rdata);
            }
        });
    };
    
    var parseGoogleCatalogAnswer = function(answer) {
        var arr = answer.split(' ');
        if (arr.length != 3) return answer;
        
        return {
            firstSeen: new Date(arr[0] * 1000*60*60*24),
            lastSeen: new Date(arr[1] * 1000*60*60*24),
            timesSeen: Number(arr[2])
        };
    };
    
    /* Query the google certificate catalog to know when google saw this certificate
     */
    dns.queryGoogleCertificateCatalog = function(sha1, callback) {
        var nameToResolve = sha1 + '.certs.googlednstest.com';
        
        dns.query(nameToResolve, 'TXT', function(data) {
            if (data === undefined || data.answer === undefined || data.answer.length == 0
                || data.answer[0] === undefined || data.answer[0].rdata === undefined
                || data.answer[0].rdata.length == 0) {
                callback(undefined);
            } else {
                callback(parseGoogleCatalogAnswer(data.answer[0].rdata[0]));
            }
        });
    };
})(jQuery);

@@ -29,20 +29,16 @@
 ined) %7B%0A
-    
 %0A    // 
@@ -97,16 +97,368 @@
 secure.%0A
+    // But except if the jsondns source code is available locally it's not really possible as cross-domain requests%0A    // aren't really supported everywhere (And IE is annoying as usual see http://goo.gl/fz3uL).     %0A    var dataType = 'jsonp';%0A    %0A    // jsondns is a an open source ruby script (Apache 2.0 license) : https://github.com/jpf/jsondns%0A
     var 
@@ -500,36 +500,8 @@
 N/';
-%0A    var dataType = 'jsonp';
 %0A%0A  
@@ -812,24 +812,229 @@
     %7D;%0A    %0A
+    /* Query the dommain name associated with a given IP address.%0A     *%0A     * The argument to the callback is either undefined if nothing was found%0A     * or a string containing the domain name.%0A     */%0A
     dns.quer
@@ -1157,16 +1157,43 @@
 3%7D)/);%0A%0A
+        var nameToResolve;%0A
         
@@ -1205,18 +1205,17 @@
 pv4 
-==
+!
 = null) 
 retu
@@ -1214,25 +1214,14 @@
 ll) 
-return;%0A        %0A
+%7B%0A    
     
@@ -1242,24 +1242,28 @@
 ();%0A        
+  
+  
 ipv4.reverse
@@ -1266,35 +1266,35 @@
 erse();%0A        
-var
+   
  nameToResolve =
@@ -1328,16 +1328,256 @@
 .arpa';%0A
+        %7D else %7B%0A            // FIXME : Parse as an ipv6 if possible and then use the%0A            //         %5Bxxx%5D.ipv6.arpa name instead of %5Bxxx%5D.in-addr.arpa%0A            %0A            callback(undefined);%0A            return;    %0A        %7D%0A
         
@@ -2011,16 +2011,115 @@
  answer;
+%0A%0A        var conversion = 1000*60*60*24; // Days since unix epoch -%3E milliseconds since unix epoch
 %0A       
@@ -2174,39 +2174,37 @@
 te(arr%5B0%5D * 
-1000*60*60*24
+conversion
 ),
+ 
 %0A           
@@ -2232,29 +2232,26 @@
 rr%5B1%5D * 
-1000*60*60*24
+conversion
 ),%0A     
@@ -2293,36 +2293,32 @@
       %7D;%0A    %7D;%0A
-    
 %0A    /* Query th
@@ -2386,16 +2386,595 @@
 tificate
+.%0A     *%0A     * The argument to the callback is either undefined if the sha1 hash isn't known to google or%0A     * an object with 3 properties :%0A     *  - firstSeen : The date of the first sighting of this certificate.%0A     *  - lastSeend : The date of the most recent  sighting of this certificate.%0A     *  - timesSeen : The number of times this certificate was seen between theses dates.%0A     *%0A     * The feature and format of the answer are specified in a blog post available at :%0A     * http://googleonlinesecurity.blogspot.com/2011/04/improving-ssl-certificate-security.html
 %0A     */

Add some comments to dns.js