Which DNS zone file is the best?
I have a couple of forward/reverse zone files for BIND9 that I have collected from tutorials. It seems that each of them seem to be able to resolve one thing but then lack to resolve another in all of them.
Out of the three which seem the best, feel free to revise them/combine them as I am in need of the best zone file as I am helping a company setup a DNS server on a Debian 7 linux box. **PLEASE NOTE** (I have replaced the actual domain name with "domain" to hide the domain) (The hostname name is simply "hostname" to hide hostname) (I have organized each of set of zone files into 3) 1. Forward Zone Code:
$ORIGIN domain.com. Code:
$ORIGIN 12.168.192.in-addr.apra. 2. Forward Zone Code:
$TTL 3D Code:
$TTL 3D 3. Forward Zone (PLEASE NOTE ON THIS ONE HOSTMASTER IS ACTUALLY HOSTMASTER, NOT TO BE CONFUSED WITH HOSTNAME) Code:
; Code:
; |
There's a typo in the $ORIGIN statement in the first reverse zone ("in-addr.apra").
The indentation in the second forward zone and the second reverse zone is horrible, but otherwise they look OK. Instead of just posting a bunch of zone files, could you perhaps tell us the exact nature of the problem? Which records are the server unable to resolve? |
Quote:
1. Forward/Reverse nslookup hostname - Resolves nslookup domainname - DOESNT Resolve (weird) nslookup hostname.domain - Resolves nslookup www domainname.com - Resolves (weird) nslookup www.yahoo.com - Resolves (Extra below) nslookup www. domainname.com - Resolves nslookup mail.domainname.com - Resolves nslookup ftp.domainname.com - Resolves nslookup dns1.domainname.com - Resolves nslookup www.yahoo.com - Resolves 2. Forward/Reverse nslookup hostname - Resolves nslookup domainanme - Resolves nslookup hostname.domainname - Resolves 3. Forward/Reverse nslookup hostname - Resolves nslookup domainanme - Resolves nslookup hostname.domainname - Resolves (Extra below) nslookup www. domainname.com - Resolves nslookup mail.domainname.com - Resolves nslookup ftp.domainname.com - Resolves nslookup dns1.domainname.com - Resolves nslookup www.yahoo.com - Resolves Seems like 2 and 3 work fine and 1 is the crappy one. Does anyone else know of any other things I should add to these zones? I think I will stick with the first one for now. Thanks for your help, I didnt think of doing this. EDIT: I am noticing that when I try and ping the domain on one of the other computers it cant ping the domain. I can ping the hostname but not the domainname, why is this? I think I need to add some type of A record for my external IP, what would that look like? Would it be something like "dns1 IN A x.x.x.x" (the x's are my external IP) |
For #1, there is no definition given for the domain name, so how could it return a definition? And why is www.domainname lookup wierd - you did give it a definition.
In the reverse, you give different IP numbers than used in the forward lookup... (reverse)192.168.0.1, .2, .3, .4 and in the forward everything is 192.168.12.137 In #2, you have what might be a typo... "hostname.domain.com..", and you have a reverse reference to 192.168.12.2, but without a forward reference. In #3, looks fine, though again there is a reverse reference to 192.168.12.2 without a forward reference. |
Alright I will answer all of your questions/feedback in order, thanks btw. (I am thinking of dropping #2 as it seems the weirdest one for me. For #1 like you said it DOES NOT have anythig for the domain. To do so in the forward zone, would I just add:
"domain.com. IN NS hostname.domainname.com." And then for the reverse zone would I type: " IN NS hostname.domainname.com." As for the other responsive you said I gave the wrong IPs, would I replace 1,2,3,4 with 137? And how do I make it so its 12.137 and not 0.137 or somethig, I am a bit confused. It is a typo, extra dot, and do I change 2 to 137? However I will probably not use 2. As for the reverse with 2, once again, change that to 137? And then to add a forward record, what do I add? Thanks for the help! |
Yes the "IN NS" would be valid. But you still would need an A record for the hostname.
Normally all forward records are <name> IN A <IP number> - which why the domain can't be identified - no A record. For reverse lookups, it is the zone definition (in the named.conf file) that defines how the IP numbers are used. A "zone "12.168.192.ipv4.arpa" IN {....} would set the the IP base to 192.168.12.x, then within the file, only the last octet is needed. |
All times are GMT -5. The time now is 05:42 AM. |