Hello there,
TLDR;
Does anyone know of an easy to deploy “DNS solution” that will allow me to deploy a rudimentary DNS solution similar to my /etc/hosts file, that simply responds to DNS queries that it can anser from a local file (preferably similar to my /etc/hosts file, or an /etc/resolve.conf file in dnsmasq world). Crucually, if it does not have an IP address for a record, it should just respond as such, rather than trying to get an answer from an upstream DNS server, or saying that there is no record. This should hopefully allow my computer to then try and get the answer from the secondary or tertiary DNS servers I have configured. Perhaps one can do this by just deploying a debian/ubuntu server, editing its /etc/hosts file, and configuring it to answer incoming DNS queries with it?
Important Caveat
In case it matters, it is important to note that none of the DNS servers are an authority on a domain. E.g. I may have server1.programster.org
configured i one of the DNS servers, and a record for server2.programster.org
in the other.
Long Version
I have a bit of a complicated setup to do with the fact that I quite often use a VPN to connect to servers across two different networks, each of which has its own DNS server that knows of its local services behind a NAT. Each of these DNS servers forwards requests that it doesn’t know about to another like Google.
I know that I can configure my linux computer to specify multiple DNS servers, and it appears to always use the first one on the list, unless it is offline, in which case it will use the second one. This will mean that whilst the first one is online, if the record I’m looking for is only in the second one, I won’t retrieve it. I’ve seen that one can configure DNS servers (I’ve only ever configured a dnsmasq server) to forward their requests to each other, but neither of these servers currently have direct access to each other as the networks are not joined in any way and are not publicly accessible. I only have access to both because my computer is inside one, and has VPN’d into the secondary network.
Is it possible to deploy a DNS server (if so please advise how), in order to have it simply look at its local cache (like a resolv.conf file), and if it is not in there, simply answer “I don’t know”, so that my computer can then proceed to the next DNS server in its list, e.g. cascading DNS as my computer tries the first, then second, then the third until it gets an answer.