I installed bind
on a CentOS 6 server for configuring a DNS zone for defining a domain. My /etc/named.conf
is this:
options {
# listen-on port 53 { 127.0.0.1; };
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 { any; };
recursion no;
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";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
zone "xxxxxx.yyy" IN {
type master;
file "xxxxxx.yyy.zone";
allow-update {none;};
};
and my zone configuration file (/var/named/xxxxxx.yyy.zone
) based on TLDP is:
$TTL 86400
@ IN SOA ns1.xxxxxx.yyy. root.xxxxxx.yyy. (
2014011001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS ns1.xxxxxx.yyy.
@ IN NS ns2.xxxxxx.yyy.
ns1 IN A aaa.bbb.cc.ddd
ns2 IN A aaa.bbb.cc.ddd
I set nameserver of domain to ns1.xxxxxx.yyy
and ns2.xxxxxx.yyy
and i can get this nameserver on whois:
meysam@freedom:~$ whois xxxxxx.yyy
// blah blah blah
% Information related to 'xxxxxx.yyy'
domain: xxxxxx.yyy
ascii: xxxxxx.yyy
// blah blah blah
nserver: ns1.xxxxxx.yyy
nserver: ns2.xxxxxx.yyy
but when i ping domain, it return unknown host error:
meysam@freedom:~$ ping xxxxxx.yyy
ping: unknown host xxxxxx.yyy
also output of nslookup
is similar:
meysam@freedom:~$ nslookup xxxxxx.yyy
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
*** Can't find yyyyyy.xxx: No answer
For more information, i append output of dig
command:
meysam@freedom:~$ dig xxxxxx.yyy
; <<>> DiG 9.9.5-3ubuntu0.5-Ubuntu <<>> xxxxxx.yyy
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57346
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;xxxxxx.yyy. IN A
;; AUTHORITY SECTION:
xxxxxx.yyy. 6606 IN SOA ns1.xxxxxx.yyy. root.xxxxxx.yyy. 2014011001 3600 1800 604800 86400
;; Query time: 123 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Fri Dec 25 20:57:36 IRST 2015
;; MSG SIZE rcvd: 87
What's the problem? How can i fix this error?
Any guide is welcome. Thanks.
It appears you are querying for an A record, when none is defined for the root of the domain.
Try adding one in your zone file.
@ IN A aaa.bbb.cc.ddd