I would like to implement a DNS client which should be able to resolve any valid domain public, private or otherwise (tor,i2p). What's the best way to achieve this?
I know that I need to pick a particular DNS server based on the TLD, for e.g, in order to resolve Tor I should have access to Tor network.
if it's .onion --> local (contact tor node)
if it's .com --> 8.8.8.8 (any public)
if it's .tk --> 80.80.80.80 (freenom) and so on ....
I'm looking for an idea on different possible and efficient ways to achieve this. The few options that I know of:
- bash script using dig, pointing to a specific dns server based on TLD
- BIND dns server config based on TLD
- writing a custom python program
Love to get your ideas. Please let me know if similar programs exist.