Correct Bind DNS configuration for both internal and external network with Ubuntu Server 20.04
Yes, this is possible. ISC BIND has a special feature, called "views". See for example, here and here.
Basically you do the following.
You need two zone files, one for "external" clients, other for "internal". I assume you already have configured it for "external" clients. Let's say, the config is like this:
zone "dipe****.sch.gr" IN {
type master;
file "pri/dipe****.sch.gr.zone";
};
You change that into:
view "internal" {
match-clients { 10.0.0.0/8; };
zone "dipe****.sch.gr" IN {
type master;
file "pri/dipe****.sch.gr.zone_int";
};
};
view "external" {
match-clients { any; };
recursion no;
zone "dipe****.sch.gr" IN {
type master;
file "pri/dipe****.sch.gr.zone";
};
};
Note your current zone configuration was migrated into external view. Also note, the order of views is important, internal view must appear before external, because external view definition has a wildcard catch-all in match-clients.
Then, DNS queries from 10.x.x.x will be answered from the file ''dipe****.sch.gr.zone_int'', this is where you configure your private addresses. All queries from clients who doesn't match 10.x.x.x will be answered from ''dipe****.sch.gr.zone'', which is for public addresses.
If your internal clients also exist in other networks (192.168.x.x, 172.16.x.x), add them into match-clients
of internal view. You can also configure an acl and put that into match-clients instead of specifying them in the view directly.