{"id":73,"date":"2010-01-23T05:17:44","date_gmt":"2010-01-23T05:17:44","guid":{"rendered":"http:\/\/poojanwagh.opalstacked.com\/techblog\/?p=73"},"modified":"2010-01-23T05:26:09","modified_gmt":"2010-01-23T05:26:09","slug":"bash-script-to-search-for-3-letter-domains","status":"publish","type":"post","link":"https:\/\/tech.poojanblog.com\/blog\/hosted-web\/bash-script-to-search-for-3-letter-domains\/","title":{"rendered":"Bash script to search for 3-letter domains"},"content":{"rendered":"<p>Here it is for the <code>.us<\/code> TLD:<br \/>\n<code><br \/>\n#!\/bin\/bash<\/p>\n<p>tld=&#8221;us&#8221;<\/p>\n<p>for k in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z; do<\/p>\n<p>   whois &#8212; &#8220;${k}.${tld}&#8221; | egrep &#8220;Domain Name|Not found&#8221;<\/p>\n<p>   for l in &#8211; 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z; do<\/p>\n<p>      whois &#8212; &#8220;${k}${l}.${tld}&#8221; | egrep &#8220;Domain Name|Not found&#8221;<\/p>\n<p>      for m in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z; do<\/p>\n<p>         whois &#8212; &#8220;${k}${l}${m}.${tld}&#8221; | egrep &#8220;Domain Name|Not found&#8221;<br \/>\n      done<br \/>\n   done<br \/>\ndone<br \/>\n<\/code><\/p>\n<p>And here it is for the <code>.nu<\/code> TLD:<br \/>\n<code><br \/>\n#!\/bin\/bash<br \/>\nfor k in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z; do<\/p>\n<p>   whois &#8220;${k}.nu&#8221; | grep &#8220;ASCII&#8221;<\/p>\n<p>   for l in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z; do<\/p>\n<p>      whois &#8220;${k}${l}.nu&#8221; | grep &#8220;ASCII&#8221;<\/p>\n<p>      for m in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z; do<br \/>\n         whois &#8220;${k}${l}${m}.nu&#8221; | grep &#8220;ASCII&#8221;<br \/>\n      done<br \/>\n   done<br \/>\ndone<br \/>\n<\/code><\/p>\n<p>You&#8217;ll note that the expression being <code>grep<\/code>ed for is different between the two: there&#8217;s no universal method of detecting the existence\/non-existence of domains that works for all TLD&#8217;s.<\/p>\n<div class='wp_likes' id='wp_likes_post-73'><a class='like' href=\"javascript:wp_likes.like(73);\" title='' ><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/tech.poojanblog.com\/blog\/wp-content\/plugins\/wp-likes\/images\/like.png\" alt='' border='0'\/><\/a><span class='text'>Be the first to like.<\/span><\/p>\n<div class='like' ><a href=\"javascript:wp_likes.like(73);\">Like<\/a><\/div>\n<div class='unlike' ><a href=\"javascript:wp_likes.unlike(73);\">Unlike<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Here it is for the TLD: And here it is for the TLD: You&#8217;ll note that the expression being ed for is different between the two: there&#8217;s no universal method of detecting the existence\/non-existence of domains that works for all TLD&#8217;s. Be the first to like. Like Unlike<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20],"tags":[],"class_list":["post-73","post","type-post","status-publish","format-standard","hentry","category-hosted-web"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/posts\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/comments?post=73"}],"version-history":[{"count":5,"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/posts\/73\/revisions"}],"predecessor-version":[{"id":78,"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/posts\/73\/revisions\/78"}],"wp:attachment":[{"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/media?parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/categories?post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.poojanblog.com\/blog\/wp-json\/wp\/v2\/tags?post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}