dns-over-https icon indicating copy to clipboard operation
dns-over-https copied to clipboard

WIP: draft for hash selector

Open monperrus opened this issue 5 years ago • 4 comments

See #66

monperrus avatar Feb 05 '20 11:02 monperrus

Requires a big refactoring, see https://github.com/m13253/dns-over-https/pull/68/files#diff-545a0c1438740f4d2f9ab2f005ab9146R45

monperrus avatar Feb 05 '20 11:02 monperrus

I think we can use the hash/fnv package of the Go standard library. It provides the Fowler–Noll–Vo hash function, which is a fast algorithm for hash table use.

I think the Selector.Get function can add a parameter to pass the requested domain name to the selector, so we can calculate the hash based on the requested domain name.

m13253 avatar Feb 05 '20 16:02 m13253

I think Get method can add a parameter that record the DNS request message, like who query, when, query for what. so that the selector has enough info to evaluate which upstream should be return. if selector doesn't care this info, just ignore it

Sherlock-Holo avatar Feb 05 '20 18:02 Sherlock-Holo

I think Get method can add a parameter that record the DNS request message, [...] if selector doesn't care this info, just ignore it

Agree.

monperrus avatar Feb 06 '20 06:02 monperrus