0

I've tried to configure my BIND-DNS server, so it will respond to to DNS requests made to a subdomain mail.prognoza.cu.cc of my domain prognoza.cu.cc .

I've defined an NS record of mail.prognoza.cu.cc with the server IP as the content.

I've also configured BIND as followed:

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

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

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

       zone "mail.prognoza.cu.cc" IN {
                type master;
                file "/var/named/prognoza.cu.cc.zone";
                allow-update { none; };
        };
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

here is prognoza.cu.cc.zone:

@ IN SOA     ns1.prognoza.cu.cc. hostmaster.prognoza.cu.cc. (
        2013042201  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        3600       ;Minimum TTL
)

; Specify our two nameservers
                IN      NS             localhost.
; Resolve nameserver hostnames to IP, replace with your two droplet IP addresses.
ns1             IN      A               31.220.108.9

; Define hostname -> IP pairs which you wish to resolve
@               IN      A               31.220.108.9
www             IN      A               31.220.108.9

For some reason it doesn't work. Whenever I nslookup mail.prognoza.cu.cc, it fails, and this is the result of dig, within the server:

dig mail.prognoza.cu.cc ANy

; <<>> DiG 9.9.4-RedHat-9.9.4-38.el7_3.1 <<>> mail.prognoza.cu.cc ANy
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 20200
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mail.prognoza.cu.cc.           IN      ANY

;; Query time: 39 msec
;; SERVER: 31.220.19.53#53(31.220.19.53)
;; WHEN: Tue Feb 14 06:34:41 IST 2017
;; MSG SIZE  rcvd: 37

For some reason, no record is found.

Can someone figure out what the problem is?

EDIT

named-checkzone mail.prognoza.cu.cc /var/named/prognoza.cu.cc.zone

returns:

named-checkzone mail.prognoza.cu.cc /var/named/prognoza.cu.cc.zone
/var/named/prognoza.cu.cc.zone:1: no TTL specified; using SOA MINTTL instead
zone mail.prognoza.cu.cc/IN: loaded serial 2013042201
OK

here is part of the named status:

Feb 15 06:46:37 hostname9727 named[19352]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0....al 0
Feb 15 06:46:37 hostname9727 named[19352]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Feb 15 06:46:37 hostname9727 named[19352]: /var/named/prognoza.cu.cc.zone:1: no TTL specified; using SOA M...tead
Feb 15 06:46:37 hostname9727 named[19352]: zone localhost/IN: loaded serial 0
Feb 15 06:46:37 hostname9727 named[19352]: zone mail.prognoza.cu.cc/IN: loaded serial 2013042201
Feb 15 06:46:37 hostname9727 named[19352]: zone localhost.localdomain/IN: loaded serial 0
Feb 15 06:46:37 hostname9727 systemd[1]: Started Berkeley Internet Name Domain (DNS).
Feb 15 06:46:37 hostname9727 named[19352]: all zones loaded
Feb 15 06:46:37 hostname9727 named[19352]: running
Feb 15 06:46:37 hostname9727 named[19352]: zone mail.prognoza.cu.cc/IN: sending notifies (serial 2013042201)
Hint: Some lines were ellipsized, use -l to show in full.

EDIT 2#

 named-checkconf -zj

/var/named/prognoza.cu.cc.zone:1: no TTL specified; using SOA MINTTL instead
zone mail.prognoza.cu.cc/IN: loaded serial 2013042201
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: loaded serial 0
prognoza
  • 121
  • 2
  • 8
  • Please don't use `@ IN NS localhost.` only use actual name servers in NS records or, if you only have a [single name server](http://serverfault.com/q/710108/37681), only create a NS record for that. Are there any Bind startup and/or error messages? What do you get warnings errors with `named-checkzone mail.prognoza.cu.cc /var/named/prognoza.cu.cc.zone` – HBruijn Feb 14 '17 at 07:57
  • Do not use ANY to do tests. Use dig with the @ specifier to specify precisely the nameserver you query and ask for a specific resource type (A, AAAA, etc.). First you do not need to do a delegation to have the mail. record in can be directly in the top zone. Also you have various strange setup: authoritative nameservers for cu.cc does not know anything about prognoza.cu.cc (no delegation), but they have a NS record for mail.prognoza.cu.cc with an IP address where it should be a name. – Patrick Mevzek Feb 14 '17 at 22:27
  • @HBruijn so should I delete @ IN NS localhost.? and replace it with what? I would like that prognoza.cu.cc redirects all DNS requests made to mail.prognoza.cu.cc , to my server. It has no separate DNS address, only fixed IP. I would like that I be able to determine for mail.prognoza.cu.cc any record I would like via my bind server. I've added the result of the command you've given me. Patrick Mevzek I tried to use dig prognoza.cu.cc @, I got: dig: couldn't get address for '': not found . thanks. – prognoza Feb 15 '17 at 04:57
  • `SERVFAIL` suggests that some form of configuration error is likely. What do the logs say, what does `named-checkconf -zj` say? – Håkan Lindqvist Feb 15 '17 at 07:09
  • @HåkanLindqvist I've added what you asked for. Where is BIND's log file? – prognoza Feb 18 '17 at 16:00
  • @prognoza dependson your system, usually /var/log/messages, syslog, or journalctl -f – Jacob Evans Feb 18 '17 at 16:28
  • have you updated the serial in your zone file after you made changes? – ivanivan Feb 18 '17 at 16:36

0 Answers0