Soporte para configurar el servidor DNS bind9 para una red privada

Soporte para configurar el servidor DNS bind9 para una red privada

Tengo varios servidores en mi red doméstica (192.168.0.0/24) y me gustaría configurar bind9 como servidor DNS, para poder resolver más fácilmente las direcciones IP de estas máquinas por nombre.

Instalé y configuré bind9 en ubuntu 20.04 de la siguiente manera:siguiendo este tutorial bastante de cerca.

2 zonas: epicsystems.local.com - /etc/bind/zones/db.epicsystems.local.com

    $TTL    604800
@   IN  SOA ns1.epicsystems.local.com. admin.epicsystems.local.com. (
                  3     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
;
; name servers - NS records
    IN  NS  ns1.epicsystems.local.com.

; name servers - A records
ns1.epicsystems.local.com.  IN  A   192.168.0.69


; 192.168.0.0/16 - A records
host2.epicsystems.local.com.    IN  A    192.168.0.67
host1.epicsystems.local.com         IN  A    192.168.0.66

db.192.168 -- zona de búsqueda inversa

;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@   IN  SOA ns1.epicsystems.local.com. admin.epicsystems.local.com. (
                  3     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
;

;name servers - NS records
    IN  NS  ns1.epicsystems.local.com.

;PTR records
69.0    IN  PTR ns1.epicsystems.local.com.          ;192.168.0.69
66.0    IN  PTR host1.epicsystems.local.com.            ;192.168.0.66
67.0    IN  PTR host2.epicsystems.local.com.        ;192.168.0.67

Mi llamado.conf.local en /etc/bind/named.conf.local tiene:

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone "epicsystems.local.com"{
    type master;
    file "/etc/bind/zones/db.epicsystems.local.com"; #zone file path
};

zone "168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/zones/db.192.168"; #192.168.0.0/16 subnet
};

Revisé la sintaxis de la configuración y las zonas, y sintácticamente es válida, pero no lo es.laboral.

Asigno a mi Mac local el servidor dns 192.168.0.69 y pruebo un nslookup para ubuntu.com. Esto funciona, por lo que bind9 funciona en esa medida.

Si luego intento un nslookup para host1 o host2, falla. El registro misceláneo para bind9 muestra las zonas que se están configurando:

09-Aug-2021 21:23:34.627 zoneload: info: managed-keys-zone: loaded serial 11
09-Aug-2021 21:23:34.627 zoneload: info: zone 0.in-addr.arpa/IN: loaded serial 1
09-Aug-2021 21:23:34.631 zoneload: info: zone 255.in-addr.arpa/IN: loaded serial 1
09-Aug-2021 21:23:34.635 zoneload: info: zone 127.in-addr.arpa/IN: loaded serial 1
09-Aug-2021 21:23:34.635 zoneload: info: zone 168.192.in-addr.arpa/IN: loaded serial 3
09-Aug-2021 21:23:34.639 zoneload: info: zone localhost/IN: loaded serial 2
09-Aug-2021 21:23:34.639 zoneload: info: zone epicsystems.local.com/IN: loaded serial 3
09-Aug-2021 21:23:34.639 general: notice: all zones loaded
09-Aug-2021 21:23:34.639 general: notice: running
09-Aug-2021 21:23:34.743 dnssec: info: managed-keys-zone: Key 20326 for zone . is now trusted (acceptance timer complete)
09-Aug-2021 21:23:34.811 resolver: info: resolver priming query complete
09-Aug-2021 21:23:42.131 dnssec: info:   validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.143 dnssec: info:   validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.163 dnssec: info:   validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.231 dnssec: info:   validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.247 dnssec: info:   validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.335 dnssec: info:   validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.347 dnssec: info:   validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.415 dnssec: info:   validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.603 dnssec: info:   validating com/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.623 dnssec: info:   validating com/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.707 dnssec: info: validating com/DNSKEY: got insecure response; parent indicates it should be secure
09-Aug-2021 21:23:42.715 dnssec: info: validating com/DNSKEY: got insecure response; parent indicates it should be secure
09-Aug-2021 21:24:20.508 dnssec: info:   validating com/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:24:20.528 dnssec: info:   validating com/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:24:29.244 dnssec: info:   validating cloud/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:24:29.260 dnssec: info:   validating cloud/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:24:29.324 dnssec: info: validating cloud/DNSKEY: got insecure response; parent indicates it should be secure
09-Aug-2021 21:24:29.340 dnssec: info: validating cloud/DNSKEY: got insecure response; parent indicates it should be secure
09-Aug-2021 21:25:36.973 dnssec: info:   validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:25:36.989 dnssec: info:   validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:25:37.005 dnssec: info:   validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:25:37.093 dnssec: info:   validating ./SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:29:26.277 dnssec: info:   validating com/SOA: got insecure response; parent indicates it should be secure
09-Aug-2021 21:29:26.577 dnssec: info: validating net/DNSKEY: got insecure response; parent indicates it should be secure

Query.log muestra que llega la búsqueda de host1, pero no resuelve nada:

09-Aug-2021 21:25:15.148 client @0x7f1cc0005910 192.168.0.13#49292 (host1.epicsystems.local.com): query: host1.epicsystems.local.com IN A + (192.168.0.69)
09-Aug-2021 21:25:36.941 client @0x7f1cbc00a550 192.168.0.13#58522 (host1): query: host1 IN A + (192.168.0.69)

¿Alguien puede ver lo que he hecho mal aquí? Es la primera vez que intento configurar un servidor DNS, por lo que lo más probable es que haya cometido un error en alguna parte.

Respuesta1

host1.epicsystems.local.com         IN  A    192.168.0.66

A este registro le falta un punto final. Eso significa que un servidor DNS vinculado no lo trata como el nombre de dominio completo que desea utilizar, sino más bien como una abreviatura.

Bind agregará $ORIGIN (el nombre de la zona) a los registros abreviados, lo que hará que el registro A host1.epicsystems.local.com.epicsystems.local.com.probablemente no sea lo que pretendía.

información relacionada