Herramientas de usuario

Herramientas del sitio


proyectos:linuxservidor-dns-bind9

¡Esta es una revisión vieja del documento!


Ejemplos

DNS cache

nano /etc/bind/named.conf.options 
acl goodclients {
  192.168.0.0/24;
  localhost;
  localnets; 

};

options {
  directory "/var/cache/bind";
  recursive yes;
  allow-query { goodclients; };
  allow-query-cache { goodclients; };
  allow-recursion { goodclients; };
  forwarders {
    0.0.0.0;
    8.8.8.8;
    8.8.4.4;
  };
  .
  .
  .
};

DNS con dominio interno/externo

mkdir /etc/bind/internal /etc/bind/external

cp /etc/bind/db.empty /etc/bind/internal/db.example.com /etc/bind/external/db.example.com

cat /etc/bind/external/db.example.com

; BIND reverse data file for empty rfc1918 zone
;
; DO NOT EDIT THIS FILE - it is used for multiple zones.
; Instead, copy it, edit named.conf, and use that copy.
;
$TTL    86400
@       IN      SOA     example.com. root.example.com. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                          86400 )       ; Negative Cache TTL
;
ns      IN      A       192.168.0.102
@       IN      NS      ns
@       IN      A       192.168.0.1
www     IN      A       192.168.0.200

cat /etc/bind/internal/db.example.com

; BIND reverse data file for empty rfc1918 zone
;
; DO NOT EDIT THIS FILE - it is used for multiple zones.
; Instead, copy it, edit named.conf, and use that copy.
;
$TTL    86400
@       IN      SOA     example.com. root.example.com. (
                              1         ; Serial
                         604800 ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                          86400 )       ; Negative Cache TTL
;
@       IN      A       127.0.0.1
@       IN      NS      example.com.
www     IN      A       127.0.0.10

cat /etc/bind/named.conf.local

view "internal" {
  match-clients {127.0.0.0/8;};
  zone "example.com" {
     type master;
     file "/etc/bind/internal/db.example.com";

  };


};

view "external" {

  match-clients {192.168.0.0/24;};
  zone "example.com" {
     type master;
     //file "/etc/bind/internal/db.example.com";
     file "/etc/bind/external/db.example.com";

  };

};

Agregar a views las demas zonas:

cat /etc/bind/named.conf.default-zones

view "all" {
match-clients {any;};
.
.
.
ZONAS POR DEFECTO
.
.
};

named-checkconf

systemctl restart bind9 tail -n 20 /var/log/syslog

proyectos/linuxservidor-dns-bind9.1611549663.txt.gz · Última modificación: por manuel.floresv