1

I am using Fedora 17 with bind 9.

I tried to manually configure a DNS for a network, editing /etc/named.conf:

options {
listen-on port 53 { localhost; };
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 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";
};

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

zone "." IN {//Per tutte le zone di cui non รจ autoritario;
type hint;
file "named.ca";
};

zone "gruppo13.labreti.it" {
type master;
file "gruppo13.labreti.it.zone";
};


zone "13.168.192.in-addr.arpa" IN {
type master;
file "gruppo13.labreti.it.reverse.zone";
}


include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

PS: In the original file there are more tabulations, I just edited it to format it as code. If I look for syntax errors with named-checkconf it says it's all ok.

This is gruppo13.labreti.it.zone:

$TTL 48h
@   IN  SOA gruppo13.labreti.it.    master.gruppo13.labreti.it. (
2013032511
1d
2h
4w
1h
)

IN  NS  dns
MX  1   mail
localhost   A   127.0.0.1
gruppo13.labreti.it.    A   192.168.13.1
        AAAA    2000:0::d:1
dns A   192.168.13.2
AAAA    2000:0::d:2
www A   192.168.13.8
AAAA    2000:0::d:8
ftp CNAME   gruppo13.labreti.it.
mail    A   192.168.13.3
AAAA    2000:0::d:3

PS: Same thing is valid for this file and the following file.

And this is gruppo13.labreti.it.reverse.zone:

$TTL 48h
@   IN  SOA gruppo13.labreti.it. master.gruppo13.labreti.it. (
2013032511
1d
2h
4w
1h
)
NS  gruppo13.labreti.it.
2   PTR dns
8   PTR www
3   PTR mail

I make named start with the following command:

$ sudo systemctl start named.service

Then I enter this command:

$ sudo ifconfig eth0 192.168.13.100 netmask 255.255.255.0 broadcast 192.168.13.255

After this I edit resolv.conf in a way that the DNS has the address 192.168.13.100.

But if I run dig:

$ dig gruppo13.labreti.it

I get no answer, this is the log:

; <<>> DiG 9.9.2-rl.028.23-P1-RedHat-9.9.2-5.P1.fc17 <<>> gruppo13.labreti.it
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 58814
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;gruppo13.labreti.it.       IN  A

;; Query time: 13 msec
;; SERVER: 192.168.13.100#53(192.168.13.100)
;; WHEN: Mon Mar 25 23:31:28 2013
;; MSG SIZE  rcvd: 48
Ramy Al Zuhouri
  • 261
  • 1
  • 4
  • 14

1 Answers1

3

If you do this in this order then you need to reload bind before it starts listen on this IP. You can check where bind is listening by:

netstat -an | grep :53

(for normal queries udp is interesting, like this:

udp        0      0 127.0.0.2:53            0.0.0.0:*
udp        0      0 127.0.0.1:53            0.0.0.0:*

)

dsznajder
  • 547
  • 4
  • 13