Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server can't find NXDOMAIN

Tags:

dns

centos

I'm just tring to configure a DNS server in my local I configure the /etc/named.conf

options {
    listen-on port 53 {
            127.0.0.1; 192.168.220.135;
            };
    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.220.0/24;
            };
    allow-transfer{
            localhost; 192.168.220.136;
            };
    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";
    also-notify {
            };
    };
    logging {
    channel default_debug {
            file "data/named.run";
            severity dynamic;
    };
    };
    zone "." IN {
    type hint;
    file "named.ca";
    };
    zone "ayoub.local" IN {
    type master;
    file "direct.zone";
    #allow-update {none;};
    };
    zone "220.168.192.in-addr.arpa" IN {
    type master;
    file "inverse.zone";
    #allow-update {none;};};
    include "/etc/named.rfc1912.zones";
    include "/etc/named.root.key";

and /var/named/direct.zone

    **$TTL 3H
    @       IN SOA  MasterDNS.ayoub.local. root.ayoub.local. (
                                            20160421        ; serial
                                            1D              ; refresh
                                            1H              ; retry
                                            1W              ; expire
                                            3H )            ; minim
    @               IN      NS      MasterDNS.ayoub.local.
    @               IN      NS      SlaveDNS.ayoub.local.
    @               IN      A       192.168.220.135
    @               IN      A       192.168.220.136
    @               IN      A       192.168.220.137
    MasterDNS       IN      A       192.168.220.135
    SlaveDNS        IN      A       192.168.220.136
    Client          IN      A       192.168.220.137    

and the /var/named/inverse.zone

     $TTL 3H
    @       IN SOA  MasterDNS.ayoub.local. root.ayoub.local. (
                                            20160418        ; serial
                                            1D              ; refresh
                                            1H              ; retry
                                            1W              ; expire
                                            3H )            ; minimum
    @               IN      NS      MasterDNS.ayoub.local.
    @               IN      NS      SlaveDNS.ayoub.local.
    @               IN      PTR     ayoub.local.
    MasterDNS       IN      A       192.168.220.135
    SlaveDNS        IN      A       192.168.220.136
    Client          IN      A       192.168.220.137
    135             IN      PTR     MasterDNS.ayoub.local.
    136             IN      PTR     SlaveDNS.ayoub.local.
    137             IN      PTR     Client1.ayoub.local.

and the /etc/resolv.conf

domain ayoub.local
search ayoub.local
nameserver 127.0.0.1
nameserver 192.168.220.136

when i test the domaine with nslookup

;; Got SERVFAIL reply from 127.0.0.1, trying next server
;; connection timed out; trying next origin
;; Got SERVFAIL reply from 127.0.0.1, trying next server
;; connection timed out; no servers could be reached

and when i set /etc/resolv.conf with that

search localdomain
nameserver 192.168.220.2

i see comme result of nslookup

Server:         192.168.220.2
Address:        192.168.220.2#53

** server can't find ayoub.local: NXDOMAIN
like image 753
Ayoub Mk Avatar asked May 12 '16 13:05

Ayoub Mk


People also ask

What does Nxdomain mean?

NXDOMAIN is the internet's blunt way of saying “the answer to your question doesn't exist”. Technically, it's saying that the domain name referenced in the Domain Name System (DNS) query does not exist. NXDOMAIN, which stands for non-existent domain, is an answer that only an authoritative nameserver can return.

What is the command nslookup?

nslookup is the name of a program that lets an Internet server administrator or any computer user enter a host name (for example, "whatis.com") and find out the corresponding IP address or domain name system (DNS) record.


1 Answers

Sometimes error happens due to nameserver 127.0.0.1

So in resolve.conf use following or any other name server you like.

Here is my resolve.conf file

nameserver 8.8.8.8
nameserver 1.1.1.1
like image 88
David Corp Avatar answered Oct 16 '22 01:10

David Corp