If you have access to the Verisign Zone file (Verisign TLD Zone files), and wish to extract the domain names to a text file for processing by another program, or to insert the domains into a database all you need to do is grep the file like so:

For .NET domains:
grep “^[a-zA-Z0-9-]\+ NS .*” net.zone|sed “s/NS .*//”|uniq >> netdomains.txt

For .COM domains:
grep “^[a-zA-Z0-9-]\+ NS .*” com.zone|sed “s/NS .*//”|uniq >> comdomains.txt

For .EDU domains:
grep “^[a-zA-Z0-9-]\+ NS .*” edu.zone|sed “s/NS .*//”|uniq >> edudomains.txt

This will create files that just contain the list of domains, each domain on a new line.  They will be missing the .com/.net/.edu extension so you will need to add the correct extension (depending on the file) during your import process, or in you code after the import.

Be prepared to wait.  It takes over an hour to process the .COM zone file on a MacBook Pro Core2 2.8Ghz machine.  Hey… as a side benefit, you can also cook eggs on your keyboard if you are hungry. Enjoy your eggs and a little Verisign Zone File on the side!

About The Author

Mike Murray
Founder, and creator of The Geek Pub

Mike is the founder of The Geek Pub. A jack of all trades who simply enjoys the challenge creating things, whether from wood, metal, or lines of code in a computer. Mike has created all kinds of projects that you can follow and build yourself, from a retro arcade cabinet to plantation shutters for your home. As an accomplished IT Executive with 25+ years experience, Mike believes that in today's world of ever changing intense competition, IT must be strategically aligned to the business like never before.

Related Posts

Leave a Reply