Bind9 DNS sever
I have problem with setting up my dns server and another domain under it.
First I have my master domain set up as a ns1 name server and it works.
I need to add another domain which will use the ns1 name server. And when I set up it in my domain registrator with ns1.xxx ns2.xxx ns3.xxx (where ns2 and ns2) are slave name servers from free name server provider.
my /named.conf.local
zone "xxx.pl" {
type master;
notify yes;
allow-transfer {
zz.zz.zz.zz;
yy.yy.yy.yy;
kk.kk.kk.kk;
};
file "/etc/bind/domains/xxx.pl";
};
zone "xx.xx.xx.xx.in-addr.arpa" IN {
type master;
file "/etc/bind/domains/xxx.pl.rev";
allow-update { none; };
};
zone "yyy.pl" {
type master;
file "/etc/bind/domains/yyy.pl";
allow-update { none; };
};
my /domains/xxx.pl
$TTL 86400
$ORIGIN xxx.pl.
@ IN SOA ns1.xxx.pl. postmaster.xxx.pl. (#times etc);
@ IN NS ns1.xxx.pl.
@ IN NS ns2.xxx.pl.
@ IN NS ns3.xxx.pl.
@ IN A xx.xx.xx.xx
ns1 IN A xx.xx.xx.xx
ns2 IN A yy.yy.yy.yy
ns3 IN A zz.zz.zz.zz
@ IN MX 10 mx
mx IN A xx.xx.xx.xx
www IN A xx.xx.xx.xx
so till this point it seems to be fine, at least I think so 😉
but when I need to add a new domain there is some kind of problem. I tried to look for something, but whenever I change anything I doesn't affect it at all.
my domains/yyy.pl
$TTL 86400
$ORIGIN yyy.pl.
@ IN SOA ns1.xxx.pl. postmaster.xxx.pl. (#times etc);
@ IN NS ns1.xxx.pl.
@ IN NS ns2.xxx.pl.
@ IN NS ns3.xxx.pl.
@ IN MX 10 ns1.xxx.pl.
@ IN A xx.xx.xx.xx
www IN A xx.xx.xx.xx
my domains/xxx.pl.rev
$TTL 86400
$ORIGIN xx.xx.xx.xx.in-addr.arpa.
@ IN SOA ns1.xxx.pl. postmaster.xxx.pl. (#times etc);
@ IN NS ns1.xxx.pl.
@ IN NS ns2.xxx.pl.
@ IN NS ns3.xxx.pl.
xx.xx.xx.xx.in-addr.arpa IN PTR ns1.xxx.pl.
So domain xxx.pl works good but domain yyy.pl doesn't work at all I cannot even ping it.
Thanks for any clues, and if anyone keen to look at it I can pass more info.
//edit
I updated the config files and now I can dig on the yyy.pl domain
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;yyy.pl. IN A
;; AUTHORITY SECTION:
yyy.pl. 10672 IN SOA ns1.xxx.pl. postmaster.xxx.pl. 2013041010 10800 3200 604800 10800
//edit updated and this configuration works as far as I'm aware, thanks for help!
Best Answer
The incorrect A record in yyy.pl is most likely the reason why that zone is not working. A quick check of the logs should show it rejecting that line of the file. A records should be an IP address not a hostname.
There's also quite a few missing dots off the end of some of the entries. Remember that for fields that take a hostname, a missing dot on the end means it'll add the origin. In the case of yyy.pl for example, the missing dot on the MX record will make that ns1.xxx.pl.yyy.pl.
I guess MX records will porbably work in a reverse zone but I can't see you needing it.
Also the PTR line is missing dots. Following the logic above it's actually adding a record for the following:
Edit: There's also a $ missing from the TTL setting in yyy.pl