diff --git a/link.module b/link.module
index 1e9d088..ad00db4 100644
--- a/link.module
+++ b/link.module
@@ -10,7 +10,6 @@ define('LINK_INTERNAL', 'internal');
 define('LINK_FRONT', 'front');
 define('LINK_EMAIL', 'email');
 define('LINK_NEWS', 'news');
-define('LINK_DOMAINS', 'aero|arpa|asia|biz|build|com|cat|ceo|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|post|pro|tel|travel|mobi|local|xxx');
 
 define('LINK_TARGET_DEFAULT', 'default');
 define('LINK_TARGET_NEW_WINDOW', '_blank');
@@ -1384,10 +1383,13 @@ function link_url_type($text) {
 
 /**
  * Returns the list of allowed domains, including domains added by admins via variable_set/$config.
+ * If the variable link_allowed_domains is set, restrict allowed domains to the strings in that array.
+ * If the variable link_allowed_domains is not set, allow all domains between 2 and 63 characters in length. 
+   See https://tools.ietf.org/html/rfc1034. 
  */
 function _link_domains() {
-  $link_extra_domains = variable_get('link_extra_domains', array());
-  return empty($link_extra_domains) ? LINK_DOMAINS : LINK_DOMAINS . '|' . implode('|', $link_extra_domains);
+  $link_allowed_domains = variable_get('link_allowed_domains', array());
+  return empty($link_allowed_domains) ? '[a-z][a-z0-9-]{1,62}' : implode('|', $link_allowed_domains);
 }
 
 /**
diff --git a/tests/link.validate.test b/tests/link.validate.test
index a9ac116..7f7bd4c 100644
--- a/tests/link.validate.test
+++ b/tests/link.validate.test
@@ -429,7 +429,6 @@ class LinkValidateUrlLight extends DrupalWebTestCase {
   function testValidateInternalLinks() {
     $tempfile = drupal_tempnam('public://files', 'test');
     $links = array(
-      'rss.xml',
       file_uri_target($tempfile),
       drupal_realpath($tempfile),
     );
@@ -482,8 +481,8 @@ class LinkValidateUrlLight extends DrupalWebTestCase {
       //$valid2 = valid_url($link, TRUE);
       //$this->assertEqual(TRUE, $valid2, "Using valid_url() on $link.");
     }
-    // Test if we can make a tld valid:
-    variable_set('link_extra_domains', array('frog'));
+    // Test if we can make a tld allowable:
+    variable_set('link_allowed_domains', array('frog'));
     $valid = link_validate_url('http://www.example.frog');
     $this->assertEqual(LINK_EXTERNAL, $valid, "Testing that http://www.example.frog is a valid external link if we've added 'frog' to the list of valid domains.");
   }
@@ -495,7 +494,6 @@ class LinkValidateUrlLight extends DrupalWebTestCase {
       'http://4827.0.0.2/',
       '//www.example.com/',
       'http://www.testß.com/', // ß not allowed in domain names!
-      'http://www.example.frog/', // Bad TLD
       //'http://www.-fudge.com/', // domains can't have sections starting with a dash.
       'http://example.com/index.php?page=this\that',
       'example@example.com',
@@ -504,5 +502,9 @@ class LinkValidateUrlLight extends DrupalWebTestCase {
       $valid = link_validate_url($link);
       $this->assertEqual(FALSE, $valid, 'Testing that ' . $link . ' is not a valid link.');
     }
+    // Test if we can make a tld disallowed:
+    variable_set('link_allowed_domains', array('toad'));
+    $valid = link_validate_url('http://www.example.frog');
+    $this->assertEqual(FALSE, $valid, "Testing that http://www.example.frog is an invalid external link if we've not added 'frog' to the list of valid domains.");
   }
 }
