1

I have trouble setting up a new domain and can't figure out what I'm missing. This is a domain in a closed network so there will be exactly one DNS server and I'm testing this on the very server.

I have the following settings done (I'm using bind9):

/etc/bind/named.conf:

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

/etc/bind/named.conf.options:

options {
        directory "/var/cache/bind";

        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
};

(What is that directory, btw?)

/etc/bind/named.conf.local:

zone "mydomain.com" {
        type master;
        file "mydomain.com.db";
};

zone "160.16.172.in-addr.arpa" {
        type master;
        file "rev.160.16.172.in-addr.arpa";
};

/etc/bind/mydomain.com.db:

$TTL 3D
@ IN SOA ns.mydomain.com. admin.mydomain.com. (
   201007121
   28800
   3600
   604800
   38400
);
@       IN      NS      ns1
ns1     IN      A       172.16.160.67
sonic.mydomain.com IN      A       172.16.160.67
                TXT     "Network Gateway"

named-checkzone says everything is OK.

Reverse DNS also seems to work:

root@sonic:/etc/bind# dig -x 172.16.160.67

; <<>> DiG 9.7.0-P1 <<>> -x 172.16.160.67
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38189
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;67.160.16.172.in-addr.arpa.    IN      PTR

;; ANSWER SECTION:
67.160.16.172.in-addr.arpa. 259200 IN   PTR     redmine.mydomain.com.
67.160.16.172.in-addr.arpa. 259200 IN   PTR     gw.mydomain.com.

;; AUTHORITY SECTION:
160.16.172.in-addr.arpa. 259200 IN      NS      ns.mydomain.com.

;; Query time: 0 msec
;; SERVER: 172.16.160.67#53(172.16.160.67)
;; WHEN: Tue Jul 13 08:46:35 2010
;; MSG SIZE  rcvd: 108

(I have a few extra domains in the reverse DNS file that I have removed from the zone file while trying to solve this.)

But the domain can't be found:

root@sonic:/etc/bind# dig mydomain.com

; <<>> DiG 9.7.0-P1 <<>> mydomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 45088
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mydomain.com.                      IN      A

;; Query time: 0 msec
;; SERVER: 172.16.160.67#53(172.16.160.67)
;; WHEN: Tue Jul 13 08:49:27 2010
;; MSG SIZE  rcvd: 26

I have defined the /etc/resolv.conf to only include the address of that server as the nameserver.

I'm guessing I'm missing something that is not implicitely told in the documents explaining how to setup a DNS server.

2 Answers 2

1

Save the zone files into /var/named instead of /etc/bind, restart BIND and try dig again.

3
  • This didn't seem to help. Jul 13, 2010 at 6:53
  • Store the zone file in /var/cache/bind as said in directory directive. The filename directive should be relative path to that directory.
    – mkudlacek
    Jul 13, 2010 at 10:41
  • Ah, I see. I'll accept your answer, because you were right, even if a bit vague for a newbie binder like me. Jul 14, 2010 at 5:56
1

I figured out the problem in the end. For some reason bind didn't find the zone definition file if I didn't put an absolute path to named.conf.local. I don't know what the default path is supposed to be, but looks like it isn't /etc/bind or /var/named.

1
  • 1
    You can use the "directory" parameter in your options file to tell BIND which directory to use as the root for its various config files. In your case you would simply add 'directory "/etc";'. This makes things easier to maintain that hard-coding paths, especially when the system grows. BTW, BIND is generally run chrooted. Jul 13, 2010 at 12:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .