TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
4.51k stars 430 forks source link

Prefetch cache record cause records to resolve externally #1110

Open deveshk0 opened 1 week ago

deveshk0 commented 1 week ago

Hi,

Once again, this is a great product. While using it in this huge production environment, we found a weird bug with caching.

Let's say we have a domain -

a.devesh.com which is managed by some external DNS like Google/Cloudflare, this domain resolves to another domain let's say a.service.com.

Now a.service.com is managed by Google/Cloudflare and internally it is managed by Technitium, Externally it points to an external IP and Techitium resolve to an internal IP

when you resolve a.devesh.com via technitium it will go to the forwarder and get a.service.com and technitium will resolve a.service.com to internal IP. But when cache prefetch is enabled it changed to external records after some time.

ShreyasZare commented 1 week ago

Thanks for the post. Will test this and let you know soon.

ShreyasZare commented 1 week ago

Thanks again for the feedback. I am trying to reproduce this issue but unable to get the results.

I am trying with blog.technitium.com domain name for the test which is publicly hosted and has a CNAME for ghs.google.com. So I have a conditional forwarder zone created for ghs.google.com and have an A record with private IP address to make the domain resolve to the required IP. I have also configured the Cache settings to set the Max TTL to 60 so that the CNAME record expires soon, and have the cache prefetch sampling to 1 min with eligibility to 5 hits/hour to allow fast testing. The CNAME is getting prefetched as expected but the domain still resolves to the private IP.

Is this the correct setup to test for this issue? Is there any change required to make it reproduce the issue?