How do I deal with the case where a domain has addresses in more than one subnet?

EG: (bob.com)

joe.bob.com    A  14400  
jim.bob.com    A  14400  
mary.bob.com   A  14400  
susan.bob.com  A  14400 


0.20.10.in-addr.arpa    14400   NS    bob.com  
0.20.10.in-addr.arpa    14400   PTR   blahblahblah   
10                      14400   PTR   joe  
11                      14400   PTR   jim


1.20.10.in-addr.arpa    14400   NS    bob.com  
1.20.10.in-addr.arpa    14400   PTR   blahblahblah   
10                      14400   PTR   mary  
11                      14400   PTR   susan

I have my 'forward' zone file setup - seems like I need multiple 'reverse' files though.

zone "bob.com" {
    type: master;

zone "0.20.10.in-addr.arpa" {
    type: master;

zone "1.20.10.in-addr.arpa" {
    type: master;

Can I put both of these entries in named.conf on the same machine or do I have to break it up somehow between multiple files / machines?


You do not need to worry about subnets when it comes to the reverse domain lookup. You should setup your files in a way that makes sense for you. Are you going to have many machines? Can you put them all in one file? If that is the case, simply let the reverse lookup 10.20.. addresses and then list the addresses in this file.


zone "20.10.in-addr.arpa" {
    type master;
    file "/etc/bind/db.10.20";
    allow-query { internal; };


$ORIGIN 20.10.in-addr.arpa.
@                       1D IN SOA       bob.com. root.bob.com. (
                                        2011020501      ; serial
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                        1D IN NS        ns.bob.com.
10.0                     PTR     joe.bob.com.
10.1                     PTR     mary.bob.com.
| improve this answer | |
  • 1
    This is also a good option if your subnets are logically broken out in some way other than by Class C blocks -- e.g. my company uses 10.site.section.x addresses, so we have a site.10.in-addr.arpa reverse zone for each site and only have to edit one spot when IP assignments at a given site change – voretaq7 Apr 15 '11 at 14:14
  • For same machine, how does it ? – Richard Jul 7 '15 at 15:13

You will need multiple files for your reverse lookup tables, one per subnet, but there is no need to do any machine based splitting. It looks like you are already on track for that.

| improve this answer | |
  • 1
    To add - The traditional solution is to create one reverse zone per class C network (/24). – voretaq7 Apr 15 '11 at 14:12

It will ultimately depend on how those subnets are delegated for reverse DNS. If they're in private IP space you and slice and dice however you want as long as the authoritative server is configured to answer them. If you're talking about public IP space, then the upstream IP provider may have to delegate them as individual subnets and in that case it would be prudent to configure your DNS server the same way they're delegating them.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.