foxcpp / go-mockdns

Boilerplate for testing of code involving DNS lookups, including unholy hacks to redirect net.Lookup* calls.
MIT License
42 stars 10 forks source link

feat: set server as authoritative #2

Closed trois-six closed 3 years ago

trois-six commented 3 years ago

Hi!

The answers of the server are not seen as authoritative whereas they should. Because it's the goal of the project no?

Thx,

Pierre

foxcpp commented 3 years ago

The goal of the project is to stub out the system resolver - it is not meant to act as an authoritative server. Is there any particular reason you need this?

trois-six commented 3 years ago

Yes, because in my project I am doing a manual recursive resolution of one DNS entry from the root servers to not have to wait before the propagation of a DNS zone modification. Since I am doing by myself the recursive resolution, I must know when I am speaking to the server that is authoritative for the DNS zone.

foxcpp commented 3 years ago

Okay, could you make it optional by adding an exported bool variable to Server object? You also probably want to unset RecursionAvailable since that's not what authoritative servers typically offer.

trois-six commented 3 years ago

ok! will do.

trois-six commented 3 years ago

Sorry, my IDE indented the code at the same time...

foxcpp commented 3 years ago

Thanks!

trois-six commented 3 years ago

I have just seen that I forgot to modify the README.

foxcpp commented 3 years ago

Fixed it.