0

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:

  1. bash script using dig, pointing to a specific dns server based on TLD
  2. BIND dns server config based on TLD
  3. writing a custom python program

Love to get your ideas. Please let me know if similar programs exist.

schroeder
  • 123,438
  • 55
  • 284
  • 319
jamie
  • 3
  • 2

1 Answers1

0

Many DNS Server implements already this logic. You can define multiple DNS server forwarder endpoints based on the domains changing the DNS server configuration file. Then you can use a standard DNS client to point to a DNS server with this configuration.

For instance here is described how to configure dnsmasq in order to forward DNS requeste to two external DNS servers based on the domain name.

NoNoNo
  • 116
  • 1
    Thank You, dnsmasq is the way to go !!!!, now i just need to find a way to resolve TOR and other private domains. – jamie Oct 21 '19 at 14:46