MiniDNS / minidns

DNS library for Android and Java SE
Other
215 stars 61 forks source link

Add configurable feature to synthesize 127.0.0.1, ::1 and localhost responses to minidns-hla #101

Open dmajirsky opened 4 years ago

dmajirsky commented 4 years ago

I'm using your HLA for a reverse lookup of 127.0.0.1 ResolverApi.INSTANCE.reverseLookup("127.0.0.1");

I would expect the result to be "localhost", or the FQDN of my machine. Minidns responds with NX_DOMAIN.

Is this behavior correct? Why does minidns respond with NX_DOMAIN instead of resolving localhost?

Flowdalic commented 4 years ago

Why does minidns respond with NX_DOMAIN instead of resolving localhost?

Because there are no resource records for 127.0.0.1, ::1, or localhost in the domain name system. Those are usually synthesized by the resolver.

I can see how this can be surprising behavior for MiniDNS's high-level API (minidns-hla). I'll probably add a configurable feature to synthesize the responses to it.