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 2 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 1I resolved the problem. I just forgot to change the group of direct. zone and inverse.zone from the root to named, command is :
chgroup named /var/named/direct.zone and I force resolve to not changing by the DHCP :
chattr +i /etc/resolv.conf