ipisp
ipisp copied to clipboard
Allow providing a custom DNS resolver
A new resolver is created at the start of the LookupIP
and LookupASN
functions.
https://github.com/ammario/ipisp/blob/a1960f6b8c8e16b3e91b7694d2cb480df3054582/dnsclient.go#L18
Would it be possible to provide a custom resolver in the following way?
client := ipisp.NewClient(&net.Resolver{})
client.LookupIP(...)
client.LookupASN(...)
I see the value in that. We could follow suit of net/http
and have package-level methods that use a DefaultDNSClient but then give users the ability to specify their own. Unfortunately I don't have time to work on this right now but I welcome contributions.