diff --git a/email_verify.inc.php b/email_verify.inc.php
index 7e66d41..9a2f915 100644
--- a/email_verify.inc.php
+++ b/email_verify.inc.php
@@ -1,8 +1,19 @@
 <?php
+
 /**
  * @file
  * Check the email for email_verify module.
  */
+
+/**
+ * Primary function for validating email addresses.
+ *
+ * @param string $mail
+ *   An email address to check, such as drupal@drupal.org.
+ *
+ * @return
+ *   Empty if address is valid, a text error string if it's invalid.
+ */
 function _email_verify_check($mail) {
   if (!valid_email_address($mail)) {
     // The address is syntactically incorrect.
@@ -15,71 +26,73 @@ function _email_verify_check($mail) {
 
   $host = substr(strchr($mail, '@'), 1);
 
-  // Let's see if we can find anything about this host in the DNS
-  if (!checkdnsrr($host, 'ANY')) {
-    return t('Email host %host invalid, please retry.', array('%host' => "$host"));
-  }
+  // If the domain is not cached, perform tests
+  if (!_email_verify_checkdb($host)) {
+    // Let's see if we can find anything about this host in the DNS
+    if (!checkdnsrr($host, 'ANY')) {
+      return t('Email host %host invalid, please retry.', array('%host' => "$host"));
+    }
 
-  // What SMTP servers should we contact?
-  $mx_hosts = array();
-  if (!getmxrr($host, $mx_hosts)) {
-    // When there is no MX record, the host itself should be used
-    $mx_hosts[] = $host;
-  }
+    // What SMTP servers should we contact?
+    $mx_hosts = array();
+    if (!getmxrr($host, $mx_hosts)) {
+      // When there is no MX record, the host itself should be used
+      $mx_hosts[] = $host;
+    }
 
-  // Try to connect to one SMTP server
-  foreach ($mx_hosts as $smtp) {
+    // Try to connect to one SMTP server
+    foreach ($mx_hosts as $smtp) {
+
+      $connect = @fsockopen($smtp, 25, $errno, $errstr, 15);
+
+      if (!$connect) continue;
+
+      if (ereg("^220", $out = fgets($connect, 1024))) {
+        // OK, we have a SMTP connection
+        break;
+      }
+      else {
+        // The SMTP server probably does not like us
+        // (dynamic/residential IP for aol.com for instance)
+        // Be on the safe side and accept the address, at least it has a valid
+        // domain part...
+        watchdog('email_verify', "Could not verify email address at host $host: $out");
+        return;
+      }
+    }
 
-    $connect = @fsockopen($smtp, 25, $errno, $errstr, 15);
+    if (!$connect)
+      return t('Email host %host is invalid, please contact us for clarification.', array('%host' => "$host"));
 
-    if (!$connect) continue;
+    $from = variable_get('site_mail', ini_get('sendmail_from'));
 
-    if (ereg("^220", $out = fgets($connect, 1024))) {
-      // OK, we have a SMTP connection
-      break;
+    // Extract the <...> part if there is one
+    if (preg_match('/\<(.*)\>/', $from, $match) > 0) {
+      $from = $match[1];
     }
-    else {
-      // The SMTP server probably does not like us
-      // (dynamic/residential IP for aol.com for instance)
-      // Be on the safe side and accept the address, at least it has a valid
-      // domain part...
-      watchdog('email_verify', "Could not verify email address at host $host: $out");
+
+    $localhost = $_SERVER["HTTP_HOST"];
+    if (!$localhost) // Happens with HTTP/1.0
+      //should be good enough for RFC compliant SMTP servers
+      $localhost = 'localhost';
+
+    fputs($connect, "HELO $localhost\r\n");
+    $out  = fgets($connect, 1024);
+    fputs($connect, "MAIL FROM: <$from>\r\n");
+    $from = fgets($connect, 1024);
+    fputs($connect, "RCPT TO: <{$mail}>\r\n");
+    $to   = fgets($connect, 1024);
+    fputs($connect, "QUIT\r\n");
+    fclose($connect);
+
+    if (!ereg ("^250", $from)) {
+      // Again, something went wrong before we could really test the address,
+      // be on the safe side and accept it.
+      watchdog('email_verify', "Could not verify email address at host $host: $from");
       return;
     }
-  }
-
-  if (!$connect)
-    return t('Email host %host is invalid, please contact us for clarification.', array('%host' => "$host"));
-
-  $from = variable_get('site_mail', ini_get('sendmail_from'));
-
-  // Extract the <...> part if there is one
-  if (preg_match('/\<(.*)\>/', $from, $match) > 0) {
-    $from = $match[1];
-  }
 
-  $localhost = $_SERVER["HTTP_HOST"];
-  if (!$localhost) // Happens with HTTP/1.0
-    //should be good enough for RFC compliant SMTP servers
-    $localhost = 'localhost';
-
-  fputs($connect, "HELO $localhost\r\n");
-  $out  = fgets($connect, 1024);
-  fputs($connect, "MAIL FROM: <$from>\r\n");
-  $from = fgets($connect, 1024);
-  fputs($connect, "RCPT TO: <{$mail}>\r\n");
-  $to   = fgets($connect, 1024);
-  fputs($connect, "QUIT\r\n");
-  fclose($connect);
-
-  if (!ereg ("^250", $from)) {
-    // Again, something went wrong before we could really test the address,
-    // be on the safe side and accept it.
-    watchdog('email_verify', "Could not verify email address at host $host: $from");
-    return;
-  }
-
-  if (
+    if (
       // This server does not like us
       // (noos.fr behaves like this for instance)
       ereg("(Client host|Helo command) rejected", $to) ||
@@ -89,16 +102,83 @@ function _email_verify_check($mail) {
       // 450 = "Requested mail action not taken: mailbox unavailable"
       ereg("^4", $to) && !ereg("^450", $to)) {
 
-    // In those cases, accept the email, but log a warning
-    watchdog('email_verify', "Could not verify email address at host $host: $to");
-    return;
-  }
+        // In those cases, accept the email, but log a warning
+        watchdog('email_verify', "Could not verify email address at host $host: $to");
+        return;
+      }
 
-  if (!ereg ("^250", $to)) {
-    watchdog('email_verify', "Rejected email address: $mail. Reason: $to");
-    return t('%mail is invalid, please contact us for clarification.', array('%mail' => "$mail"));
+    if (!ereg ("^250", $to)) {
+      watchdog('email_verify', "Rejected email address: $mail. Reason: $to");
+      return t('%mail is invalid, please contact us for clarification.', array('%mail' => "$mail"));
+    }
+    // If the previous checks pass, save the valid domain to the DB table.
+    _email_verify_updatedb($host);
   }
 
   // Everything OK
   return;
 }
+
+/**
+ * Lookup cached mail domain in the database.
+ *
+ * @param $host
+ *   Valid host/domain portion of an email address, such as drupal.org.
+ *
+ * @return
+ *   TRUE if domain is in the database and cache is valid, FALSE if a new check
+ *   should be performed.
+ */
+function _email_verify_checkdb($host) {
+  // Length of time a cached domain check is valid. Defaults to 30 days.
+  $valid = variable_get('email_verify_cached_valid', EMAIL_VERIFY_CACHED_VALID);
+  // Oldest timestamp for a valid domain
+  $oldest = time() - $valid;
+
+  $result = db_result(db_query("SELECT * FROM {email_verify} WHERE domain = '%s' AND validated >= %d AND status = 1 LIMIT 1", $host, $oldest));
+  if ($result) {
+    return TRUE;
+  }
+
+  return FALSE;
+}
+
+/**
+ * Store successful domain checks in the database.
+ *
+ * @param $host
+ *   The validated host/domain.
+ *
+ * @return
+ *   Matches drupal_write_record: FALSE if it was not saved, SAVED_NEW or
+ *   SAVED_UPDATED if it succeeded.
+ */
+function _email_verify_updatedb($host) {
+  // The record to save to the database
+  $update = new stdClass;
+  $update->domain = $host;
+  $update->validated = time();
+  $update->status = 1;
+
+  $result = db_result(db_query("SELECT * FROM {email_verify} WHERE domain = '%s'", $host));
+  if ($result) {
+    return drupal_write_record('email_verify', $update, 'domain');
+  }
+  else {
+    return drupal_write_record('email_verify', $update);
+  }
+}
+
+/**
+ * Clean the database of old records.
+ */
+function _email_verify_cleandb() {
+  // Length of time a cached domain check is valid. Defaults to 30 days.
+  $valid = variable_get('email_verify_cached_valid', EMAIL_VERIFY_CACHED_VALID);
+  $oldest = time() - $valid;
+
+  $result = db_query("SELECT * FROM {email_verify} WHERE validated <= %d", $oldest);
+  while ($record = db_fetch_array($result)) {
+    db_query("DELETE FROM {email_verify} WHERE domain = '%s'", $record['domain']);
+  }
+}
diff --git a/email_verify.install b/email_verify.install
index 89ce38b..787ffd0 100644
--- a/email_verify.install
+++ b/email_verify.install
@@ -5,6 +5,57 @@
  */
 
 /**
+ * Implementation of hook_schema().
+ */
+function email_verify_schema() {
+  $schema['email_verify'] = array(
+    'description' => 'Stores domains that were properly validated.',
+    'fields' => array(
+      'domain' => array(
+        'type' => 'varchar',
+        'length' => 64,
+        'not null' => FALSE,
+        'default' => '',
+        'description' => "Email domain.",
+      ),
+      'validated' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'Timestamp for when domain was validated.',
+      ),
+      'status' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'size' => 'tiny',
+        'description' => 'Whether the domain is valid(1) or invalid(0)',
+      ),
+    ),
+    'primary key' => array('domain'),
+    'indexes' => array(
+      'domain_status' => array('domain', 'status'),
+    ),
+  );
+
+  return $schema;
+}
+
+/**
+ * Implementation of hook_install().
+ */
+function email_verify_install() {
+  drupal_install_schema('email_verify');
+}
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function email_verify_uninstall() {
+  drupal_uninstall_schema('email_verify');
+}
+
+/**
  * Implementation of hook_enable().
  */
 function email_verify_enable() {
@@ -55,6 +106,9 @@ function email_verify_enable() {
   }
 }
 
-// Local Variables:
-// mode: php
-// End:
+/**
+ * Update 6101 - Install database schema.
+ */
+function email_verify_update_6101() {
+  drupal_install_schema('email_verify');
+}
diff --git a/email_verify.module b/email_verify.module
index 9e18aeb..61f3e2c 100644
--- a/email_verify.module
+++ b/email_verify.module
@@ -7,6 +7,11 @@
  */
 
 /**
+ * Debug mode (flog messages)
+ */
+define('EMAIL_VERIFY_CACHED_VALID', 2592000);
+
+/**
  * Implementation of hook_help().
  * @return
  * Help text for section.
@@ -61,6 +66,10 @@ function email_verify_menu() {
   return $items;
 }
 
-// Local Variables:
-// mode: php
-// End:
+/**
+ * Implementation of hook_cron().
+ */
+function email_verify_cron() {
+  require_once dirname(__FILE__) . '/email_verify.inc.php';
+  _email_verify_cleandb();
+}
