Hello everyone :) I have tried to set up my own DNS server with bind9, but although I have tried several tutorials, I still get the same error. Starting bind9 works fine but when I use nslookup
or dig
against host1
(which exists in the forward zone file) it never manages to resolve the IP address. I have the same problem with the reverse zone file, using the IP address as the argument instead of host1
. If I instead lookup, for example, microsoft.com I will get an answer.
Example:
nslookup host1.dirks.crtn
;; Got SERVFAIL reply from 192.168.56.2, trying next server
;; Got SERVFAIL reply from 192.168.56.2, trying next server
server 127.0.0.1
address 127.0.0.1#53
** server can't fint host1.dirks.crtn.dirks.crtn: SERVFAIL
I also tried host1
:
nslookup host1
;; Got SERVFAIL reply from 192.168.56.2, trying next server
server: 192.168.56.2
address 192.168.56.2#53
** server can't find host1: NXDOMAIN
With microsoft.com:
nslookup microsoft.com
server: 192.168.56.2
address: 192.168.56.2#53
Non-authoritative answer:
name: microsoft.com
address: 134.170.188.221
name: microsoft.com
address 134.170.185.46
My current files:
File /etc/bind/named.conf.options:
options {
directory "/var/cache/bind";
recursion yes;
forwarders {
8.8.8.8;
8.8.4.4;
};
allow-query {
192.168.56.0/24;
};
allow-transfer {
192.168.56.0/24;
};
};
File /etc/bind/named.conf.local:
zone "dirks.crtn" {
type master;
file "etc/bind/zones/dirks.crtn.db";
};
zone "56.168.192.in-addr.arpa" {
type master;
file "etc/bind/zones/rev.56.168.192.in-addr.arpa";
};
Forward Zone File - /etc/bind/zones/dirks.crtn.db:
$ORIGIN .
$TTL 907200 ; 1 week 3 days 12 hours
dirks.crtn IN SOA filtjener.dirks.crtn. webmaster.dirks.crtn. (
1263527838 ; serial
10800 ; refresh
3600 ; retry (1 hour)
604800 ; expire (1 week)
38400 ; minimum (10 hours 40 minutes)
)
; name server - NS records
NS filtjener.dirks.crtn.
; name server - A records
filtjener.dirks.crtn. A 192.168.56.2
$ORIGIN dirks.crtn.
host1 A 192.168.56.21
host2 A 192.168.56.22
host3 A 192.168.56.23
Reverse zone file - /etc/bind/zones/rev.56.168.192.in-addr.arpa:
$TTL 907200 ; 1 week 3 days 12 hours
@ IN SOA filtjener.dirks.crtn. webmaster.dirks.crtn. (
1263187356 ; serial
10800 ; refresh (3 hours)
3600 ; retry (1 hour)
60400 ; expire (1 week)
38400 ; minimum (10 hours 40 minutes)
)
NS filtjener.dirks.crtn.
; PTR records
21 PTR host1.dirks.crtn.
22 PTR host2.dirks.crtn.
23 PTR host3.dirks.crtn.
File /etc/resolvconf/resolv.conf.d/head:
search dirks.crtn
nameserver 192.168.56.2
File /etc/network/interfaces:
auto lo
iface eth1 inet static
address 192.168.56.2
netmask 255.255.255.0
I checked the files:
sudo named-checkconf
sudo named-chekckzone rev.56.168.192.in-addr.arpa /etc/bind/zones/rev.56.168.192.in-addr.arpa
zone rev.56.168.192.in-addr.arpa/IN: loaded serial 1263187356
OK
sudo named-checkzone dirks.crtn /etc/bind/zones/dirks.crtn.db
zone dirks.crtn/IN: loaded serial 1263527838
OK
and have restarted bind9:
sudo /etc/init.d/bind9 restart
* Stopping domain name service... bind9 [ok]
waiting for pid 2765 to die
* starting domain name service... bind9 [ok]
I'm using VirtualBox and since I haven't managed to copy and paste from VirtualBox, it might be small errors in the files.
Does anyone know what I might be doing wrong here? :) I appreciate any help :)