E
E
ettaluni2021-04-28 20:31:20
linux
ettaluni, 2021-04-28 20:31:20

How to make linux work in two DNS zones?

Good day! We have Debian 10 network-manager and two domain zones, Internet and private network. In order to be able to access the private network, I set up the generation of resolv.conf in such a way that the Internet DNS server is asked first, then the private one.

//resolv.conf
nameserver internet
nameserver private

I always thought that if the host does not find the dns records on the first server, he will go and ask the other one like a real gentleman, and so on. But not here, it was if the first dns does not know any name, the conversation will be short.
The second DNS server is indicated as a spare, if the first does not answer, it will not answer, but will not say "I don't know".
Therefore, is it possible to work in two DNS zones, if on the first server, it will not be possible to specify a private zone as an additional one? In general, all manipulations can only be carried out on a Klin machine.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Aleksandrov, 2021-04-28
@jamakasi666

You need a smarter resolver than the standard one. BIND for example and in it something like this:

zone "." IN {
    type forward;
    forward only;
    forwarders {internet;};
};

zone "private-lan.corp" IN {
    type forward;
    forward only;
    forwarders {private;};
};

There are similar ones in others, for example, there is definitely in adguard home.
There is also such a feature in systemd-resolved. I have read it but haven't tried it myself.

A
Alexey Dmitriev, 2021-04-29
@SignFinder

In the private DNS server, configure the forwarder of all unknown domains to the DNS server on the Internet and use only the private one for resolving.
Moreover, it should do this by default by root hints.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question