I have set up a home web server using Ubuntu 12.10 and I can safely say that it works with regards to router forwarding and ports being found. I know this, because switched my hosting provider's VPS SOA record to use my ISP IP with an 'A' value and had my website running from home. This verified that my server was configured correctly so I started what I believe to be the final step in making my old desktop into a full DNS server.
I found this tutorial that got me started My LAN network consists of the following:
- My router with a gateway of
10.0.0.zzz
- My server with an IP of
10.0.0.xxx
- A laptop with an IP of
10.0.0.yyy
Step 1:
I installed bind via sudo apt-get install bind9
Step2:
I configured /etc/bind/named.conf.local
with:
zone "sognwebdesign.no" {
type master;
file "/etc/bind/zones/sognwebdesign.no.db";
};
zone "0.0.10.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.0.0.10.in-addr.arpa";
};
Step3:
Updated /etc/bind/named.conf.options
with two ISP DNS addresses
Step 4:
Updated /etc/resolv.conf
with:
nameserver 10.0.0.xxx
search lan
search sognwebdesign.no
Step5:
created a “/etc/bind/zones directory
Step6:
Created /etc/bind/zones/sognwebdesign.no.db
with:
$TTL 3D
@ IN SOA ns.sognwebdesign.no. admin.sognwebdesign.no. (
2007062001
28800
3600
604800
38400
);
sognwebdesign.no. IN NS ns1.sognwebdesign.no.
sognwebdesign.no. IN NS ns2.sognwebdesign.no.
sognwebdesign.no. IN NS ns3.sognwebdesign.no.
NS1 IN A 10.0.0.1
NS2 IN A 10.0.0.2
NS3 IN A 10.0.0.3
www IN A 10.0.0.4
yuccalaptop IN A 10.0.0.19
gw IN A 10.0.0.138
TXT "Network Gateway"
Step 7:
created/etc/bind/zones/rev.0.0.10.in-addr.arpa
with:
$TTL 3D
@ IN SOA ns.sognwebdesign.no. admin.sognwebdesign.no. (
2007062001
28800
604800
604800
86400
);
zzz IN PTR gw.sognwebdesign.no.
1 IN PTR ns1.sognwebdesign.no.
2 IN PTR ns2.sognwebdesign.no.
3 IN PTR ns3.sognwebdesign.no.
yyy IN PTR yuccalaptop.sognwebdesign.no.
I then restart bind and dig-x sognwebdesign.no
and it works
Lastly I perform named-checkzone
on each of my zone files, but me reverse zone fail fails with:
sognwedesign.no/IN: has no NS records
Can anyone explain what I am doing wrong here or assist me in getting this configured correctly?
Best Answer
First of all you're using
named-checkzone
incorrectly:Use it BEFORE you reload the zones or restart your name server.
The whole point of this utility is to catch errors that would cause your zones to fail to load. It can't help you avoid mistakes if you've already restarted the server before you let it check for errors.
(BIND will happily run the same checks though, and fail for the same reasons - look at your log files.)
It's impossible for a check on
0.0.10.in-addr.arpa
to generate an error message referring tosognwedesign.no
, unless you're specifying the wrong zone name to named-checkzone.Specify the correct zone name in accordance with the manual for
named-checkzone
.Second of all,
named-checkzone
is right about the problem it's reporting -- there are no NS records in your reverse zone.Correct the issue (add NS records) to make the message go away.
This isn't black magic -- If you use the tools correctly they tell you exactly what's wrong, all you have to do is fix it.