I have been tasked by my instructor to setup a DNS server. But I don't really know if I'm doing it the right way. I am unable to resolve/ping/nslookup the name server. Syslog sais the ns1 is lame. :(
I am using four Ubuntu clients with VirtualBox, one of them configured to be the DNS server. I've set up an bridged virtual network and all hosts are able to ping eachother. I use these IP addresses inside the DNS configuration. Everything seems to be alright but I cannot reach the ns1.example.com even though it's supposed to be the main DNS.
The task: Setup DNS server with a domain and a subdomain. Main domain: SOA, NS for both domain and subdomain, glue record and A record for the subdomain. Subdomain: SOA, NS, glue and A records. Should also have mail and www records.
Please tell me my errors here. I'm constantly reading new stuff and changing the configuration but I can never get to the point where nslookup works for all the addresses, unless I remove the subdomain and add sub.domain.com as a simple A record, but that wont cut it. :P
named.conf.local
zone "domain.com"
{
type master;
file "/etc/bind/zones/domain.com.db";
};
zone "sub.domain.com"
{
type master;
file "/etc/bind/zones/sub.domain.com.db";
};
zone "0.168.192.in-addr.arpa"
{
type master;
file "/etc/bind/zones/0.168.192.in-addr.arpa";
};
domain.com.db
$TTL 3D; TTL default, 3 dagar
domain.com. IN SOA ns1.domain.com. admin.domain.com. (
2012122104; Serialnumber
28800;
3600;
604800;
38400
)
; Maindomain name servers
domain.com. IN NS ns1.domain.com.
sub.domain.com. IN NS ns2.sub.domain.com.
; Main domain A records
ns1.domain.com. IN A 192.168.1.92
ns2.sub.domain.com. IN A 192.168.1.84
sub.domain.com.db
$TTL 3D
$ORIGIN sub.domain.com.
@ IN SOA ns2.sub.domain.com. admin.sub.domain.com. (
2012122104; Serialnumber
28800;
3600;
604800;
38400
)
; Sub-domain
IN NS ns2.sub.domain.com.
domain.com. IN NS ns1.domain.com.
; Mailserver for subdomain
IN MX 10 mail.sub.domain.com.
; A records for subdomain
ns2 IN A 192.168.1.84
ns1.domain.com. IN A 192.168.1.92
; Glue records for subdomain
mail IN A 192.168.1.89
www IN A 192.168.1.72
; Canonical names for subdomain
stuff IN CNAME www
in-addr.arpa
$TTL 3D
@ IN SOA ns1.domain.com. admin.domain.com. (
2012122103;
28800;
604800;
604800;
86400
);
IN NS ns1.domain.com.
IN NS ns2.sub.domain.com.
92 IN PTR ns1.domain.com.
92 IN PTR ns2.sub.domain.com.
74 IN PTR www.sub.domain.com.
89 IN PTR mail.sub.domain.com.
Happy Holidays! ;>
Edit: I have comined it into one file, using ORIGIN$ and I can reach the ns1, but none of the subs...