Index: src/java/org/apache/nutch/util/domain/DomainStatistics.java
===================================================================
--- src/java/org/apache/nutch/util/domain/DomainStatistics.java	(revision 1333869)
+++ src/java/org/apache/nutch/util/domain/DomainStatistics.java	(working copy)
@@ -58,12 +58,13 @@
   private static final int MODE_HOST = 1;
   private static final int MODE_DOMAIN = 2;
   private static final int MODE_SUFFIX = 3;
+  private static final int MODE_TLD = 4;
 
   private int mode = 0;
 
   public int run(String[] args) throws Exception {
     if (args.length < 3) {
-      System.out.println("usage: DomainStatistics inputDirs outDir host|domain|suffix [numOfReducer]");
+      System.out.println("usage: DomainStatistics inputDirs outDir host|domain|suffix|tld [numOfReducer]");
       return 1;
     }
     String inputDir = args[0];
@@ -89,6 +90,9 @@
     } else if(args[2].equals("suffix")) {
       jobName = "Suffix statistics";
       mode = MODE_SUFFIX;
+    } else if(args[2].equals("tld")) {
+      jobName = "TLD statistics";
+      mode = MODE_TLD;
     }
 
     Configuration conf = getConf();
@@ -153,6 +157,9 @@
             case MODE_SUFFIX:
               out = URLUtil.getDomainSuffix(url).getDomain();
               break;
+            case MODE_TLD:
+              out = URLUtil.getTopLevelDomainName(url);
+              break;
           }
           if(out.trim().equals("")) {
             LOG.info("url : " + url);
Index: src/java/org/apache/nutch/util/URLUtil.java
===================================================================
--- src/java/org/apache/nutch/util/URLUtil.java	(revision 1333869)
+++ src/java/org/apache/nutch/util/URLUtil.java	(working copy)
@@ -18,7 +18,7 @@
 package org.apache.nutch.util;
 
 import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.*;
 import java.util.regex.Pattern;
 
 import org.apache.nutch.util.domain.DomainSuffix;
@@ -172,6 +172,36 @@
     return getDomainName(new URL(url));
   }
 
+  /** Returns the top level domain name of the url. The top level domain name
+   *  of a url is the substring of the url's hostname, w/o subdomain names.
+   *  As an example <br><code>
+   *  getTopLevelDomainName(conf, new http://lucene.apache.org/)
+   *  </code><br>
+   *  will return <br><code> org</code>
+   * @throws MalformedURLException
+   */
+  public static String getTopLevelDomainName(URL url) throws MalformedURLException {
+    String suffix = getDomainSuffix(url).toString();
+    int idx = suffix.lastIndexOf(".");
+    if (idx != -1) {
+      return suffix.substring(idx + 1);
+    } else {
+      return suffix;
+    }
+  }
+
+  /** Returns the top level domain name of the url. The top level domain name
+   *  of a url is the substring of the url's hostname, w/o subdomain names.
+   *  As an example <br><code>
+   *  getTopLevelDomainName(conf, new http://lucene.apache.org/)
+   *  </code><br>
+   *  will return <br><code> org</code>
+   * @throws MalformedURLException
+   */
+  public static String getTopLevelDomainName(String url) throws MalformedURLException {
+    return getTopLevelDomainName(new URL(url));
+  }
+
   /** Returns whether the given urls have the same domain name.
    * As an example, <br>
    * <code> isSameDomain(new URL("http://lucene.apache.org")
@@ -434,7 +464,7 @@
       return null;
     }
   }
-  
+
   /** For testing */
   public static void main(String[] args){
     
