ammario / ipisp

Query IP address network information in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow providing a custom DNS resolver

gnuletik opened this issue · comments

A new resolver is created at the start of the LookupIP and LookupASN functions.

var r net.Resolver

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.