lets say i have this private hostname dev.private.example.com
that is only accessible in a private network over VPN connection and i have prod.example.com
that is accessible to the internet. I have DNS servers to resolve the private hostname and then i can use the public DNS servers(google, cloudflare etc) for the public hostnames.
i will like setup dnsmasq(let me know if there is another tool) so that it will query DNS server for the private hostnames and if it is another hostname then it will resolve via the public DNS servers
How do i go about doing this?
this is what worked for me
edit
/etc/dnsmasq.conf
and have this in the fileand then create a file in the conf directory
/etc/dnsmasq.d/private.example.com.conf
and add the following in the content of the file
where the following are the nameservers
140.82.113.1
and140.82.113.2
resolving the private hostnamethen restart dnsmasq
service restart dnsmasq
now any private hostnames *.private.example.com will use those nameservers to resolve!!!
and boom!!!