If you want to keep the queries mostly in-house, you can get access to Verisign's copy of the .com zone file for free and download it once a day.
http://www.verisign.com/domain-name-services/domain-informat...
And if you don't even want to change your code, you could fire up a DNS server that serves the entries from that file.