0845680984
  1. 1 – BIND : Configure for Internal Network
  2. 2 – BIND : Configure for External Network
  3. 3 – BIND : Configure Zone Files
  4. 4 – BIND : Verify Resolution
  5. 5 – BIND : Use View Statement
  6. 6 – BIND : Set Alias (CNAME)
  7. 7 – BIND : Configure Chroot Environment
  8. 8 – BIND : Configure Secondary Server

This is an example to use View Statement in [named.conf].
On this example, Configure both settings for Internal Network like here and settings for External Network like here with View Statement in [named.conf].

[1] This example

Uses internal network [10.0.0.0/24], external network [172.16.0.80/29], domain name [srv.world], Replace them for your own environment.
( Actually, [172.16.0.80/29] is for private IP addresses, though. )

[root@soncq ~]# vi /etc/named.conf
.....
.....
# add : set ACL entry for local network
acl internal-network {
        10.0.0.0/24;
};

options {
        # change ( listen all )
        listen-on port 53 { any; };
        # change if need ( if not listen IPv6, set [none] )
        listen-on-v6 { any; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        secroots-file   "/var/named/data/named.secroots";
        recursing-file  "/var/named/data/named.recursing";
        # add local network set on [acl] section above
        # network range you allow to recive queries from hosts
        allow-query     { localhost; internal-network; };
        # network range you allow to transfer zone files to clients
        # add secondary DNS servers if it exist
        allow-transfer  { localhost; };

        .....
        .....

        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;

        managed-keys-directory "/var/named/dynamic";

        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";

        /* https://fedoraproject.org/wiki/Changes/CryptoPolicy */
        include "/etc/crypto-policies/back-ends/bind.config";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

# change all lines follows
# set internal network zones
view "internal" {
        match-clients {
                localhost;
                internal-network;
        };
        zone "." IN {
                type hint;
                file "named.ca";
        };
        zone "local" IN {
                type master;
                file "local.lan";
                allow-update { none; };
        };
        zone "0.0.10.in-addr.arpa" IN {
                type master;
                file "0.0.10.db";
                allow-update { none; };
        };
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
};

# set external network zones
view "external" {
        # match all except targets defined on [match-clients] on internal section
        match-clients { any; };
        allow-query { any; };
        # not allow recursive queries
        recursion no;
        zone "local" IN {
                type master;
                file "local.wan";
                allow-update { none; };
        };
        zone "80.0.16.172.in-addr.arpa" IN {
                type master;
                file "80.0.16.172.db";
                allow-update { none; };
        };
};
[2] For configuration of each Zone files set in [named.conf] above, refer to here.

Leave a Comment

Your email address will not be published. Required fields are marked *

Bài viết gần đây:

Shopping Cart