I’m using Cloudflare’s proxied dns to point my local web server, can you kindly help to solve a doubt?
If I request a file locally will be served locally or will be served like from a remote server?
In other words, if I visit locally service.mydomain.com/file.zip will be downloaded directly from the local web server or the file will be transferred from my network, through the Cloudflare’s proxy and finally to my client?
The specifics of how to deploy a DNS server on your LAN is out of scope for the Cloudflare Community. You might try some searching the internet for articles on how to run Unbound, but that package is not the only possible solution.