CentOS7 incapaz de resolver o nslookup para o hostname curto

1

Eu tentei configurar uma pesquisa de DNS no CentOS 7 (em uma VM de caixa virtual), que funciona para o FQDN na mesma máquina virtual que o DNS. No entanto, quando tento resolver o nome do host curto, ele falha.

Eu já vi isso funcionando em alguns servidores e queria aprender como configurá-lo sozinho. Aprecie qualquer ajuda sobre isso.

Abaixo estão as configurações:

Arquivo - /etc/named.conf

    //
    // named.conf
    //

    options {
        listen-on port 53 { 127.0.0.1; 192.168.56.101; };
        listen-on-v6 port 53 { ::1; };
        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";
        allow-query     { localhost; 192.168.0.0/24; };
        allow-transfer  { localhost; 192.168.56.101; };

        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

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

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

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

    zone "." IN {
        type hint;
        file "named.ca";
    };

    zone "eai.com" IN {
        type master;
        file "forward.linuxzadmin";
        allow-update { none; };
    };

    zone "0.168.192.in-addr.arpa" IN {
        type master;
        file "reverse.linuxzadmin";
        allow-update { none; };
    };



    include "/etc/named.rfc1912.zones";
    include "/etc/named.root.key";

Arquivo - /etc/resolv.conf

    # Generated by NetworkManager
    # nameserver 169.144.126.136
    # nameserver 146.11.115.200
    # nameserver 153.88.112.200
    # NOTE: the libc resolver may not support more than 3 nameservers.
    # The nameservers listed below may not be recognized.
    # nameserver 147.128.170.138
    # nameserver 127.0.0.1
    nameserver 192.168.56.101

Arquivo - / etc / hosts

    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 
    192.168.56.101  eai16.eai.com eai16 eai16-oam

Arquivo - /var/named/forward.linuxzadmin

    $TTL 86400
    @       IN SOA  masterdns.eai.com. root.eai.com. (
                                    2014051001      ; serial
                                            3600    ; refresh
                                            1800    ; retry
                                            604800  ; expire
                                            86400   ; minimum
    )
    @               IN      NS      masterdns.eai.com.
    @               IN      A       192.168.56.101
    masterdns       IN      A       192.168.56.101
    node1           IN      A       192.168.56.101
    eai16       IN  A   192.168.56.101

Arquivo - /var/named/reverse.linuxzadmin

    $TTL 86400
    @       IN SOA  masterdns.eai.com. root.eai.com. (
                                    2014051001      ; serial
                                            3600    ; refresh
                                            1800    ; retry
                                            604800  ; expire
                                            86400   ; minimum
    )
    @               IN      NS      masterdns.eai.com.
    @               IN      PTR     eai.com.
    masterdns       IN      A       192.168.56.101
    node1           IN      A       192.168.56.101
    eai16       IN  A   192.168.56.101
    101             IN      PTR     masterdns.eai.com.
    101             IN      PTR     node1.eai.com.
    101     IN  PTR eai16.eai.com.
    101     IN  PTR eai16.

Saída de comando

Nome do host

[root@eai16 etc]# hostname -f
eai16.eai.com
[root@eai16 etc]# hostname -s
eai16

Pesquisa NS no FQDN

[root@eai16 etc]# nslookup eai16.eai.com
Server:         192.168.56.101
Address:        192.168.56.101#53

Name:   eai16.eai.com
Address: 192.168.56.101

Dig no FQDN

[root@eai16 etc]# dig eai16.eai.com

; <<>> DiG 9.9.4-RedHat-9.9.4-38.el7_3.3 <<>> eai16.eai.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62927
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;eai16.eai.com.                 IN      A

;; ANSWER SECTION:
eai16.eai.com.          86400   IN      A       192.168.56.101

;; AUTHORITY SECTION:
eai.com.                86400   IN      NS      masterdns.eai.com.

;; ADDITIONAL SECTION:
masterdns.eai.com.      86400   IN      A       192.168.56.101

;; Query time: 0 msec
;; SERVER: 192.168.56.101#53(192.168.56.101)
;; WHEN: Wed Jun 28 21:13:38 IST 2017
;; MSG SIZE  rcvd: 98

Host no FQDN

[root@eai16 etc]# host eai16.eai.com
eai16.eai.com has address 192.168.56.101
[root@eai16 etc]# host 'hostname'
eai16.eai.com has address 192.168.56.101

Agora, todos os comandos (nslookup, dig e host) falham no nome abreviado do host.

[root@eai16 etc]# host eai16
Host eai16 not found: 2(SERVFAIL)
[root@eai16 etc]# host eai16
;; connection timed out; no servers could be reached
[root@eai16 etc]# nslookup eai16
Server:         192.168.56.101
Address:        192.168.56.101#53

** server can't find eai16: SERVFAIL

[root@eai16 etc]# dig eai16

; <<>> DiG 9.9.4-RedHat-9.9.4-38.el7_3.3 <<>> eai16
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 23006
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;eai16.                         IN      A

;; Query time: 0 msec
;; SERVER: 192.168.56.101#53(192.168.56.101)
;; WHEN: Wed Jun 28 21:25:18 IST 2017
;; MSG SIZE  rcvd: 34

Eu sei que algo está faltando / errado na minha configuração, mas não consigo descobrir o que é.

    
por WrijuB 05.07.2017 / 10:13

1 resposta

0

O problema está na configuração resolv.conf / DHCP se o resolv.conf não for estático.

Você precisa adicionar à diretiva search de resolv.conf do domínio eai.com

Quando você tenta uma pesquisa de nome DNS, as bibliotecas do resolvedor, se não obtiverem êxito, tentam alternadamente resolver o nome adicionando os domínios na diretiva de pesquisa até encontrarem um nome resolvível ou até esgotarem a lista de domínios na diretiva de pesquisa .

    
por 05.07.2017 / 10:26