Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm doing the configuration of a DNS server with Ubuntu 12.04 and Bind9. I have a list of clients like this:

192.168.101.23
192.168.101.24
192.168.101.25
192.168.102.23
192.168.102.24
192.168.102.25

This is the zone defined for forward lookup, nothing to worry about here:

CC1 IN  A   192.168.101.22
CC2 IN  A   192.168.101.23
CC3 IN  A   192.168.101.24
CC4 IN  A   192.168.102.22
CC5 IN  A   192.168.102.23
CC6 IN  A   192.168.102.24

But it's not clear to me how I'am supposed to define the reverse lookup, with two or more subnets:

22     IN      PTR     CC1.dns.net.
22     IN      PTR     CC4.dns.net.  (I think, this is way too wrong. Should I write down 102.22 instead of 22?)

Any ideas?

share|improve this question

migrated from stackoverflow.com May 22 '12 at 14:09

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 0 down vote accepted

It depends on the $ORIGIN of your zone. Usually the interesting part of a reverse DNS zone in bind looks like this:

$ORIGIN 101.168.192.in-addr.arpa.  
1    IN PTR cc1.dns.net.
2    IN PTR cc2.dns.net.

$ORIGIN 102.168.192.in-addr.arpa.  
1    IN PTR foo.dns.net.
2    IN PTR bar.dns.net.

Or in an aggregated section:

$ORIGIN 168.192.in-addr.arpa.  
1.101    IN PTR cc1.dns.net.
2.101    IN PTR cc2.dns.net.
1.102    IN PTR foo.dns.net.
2.102    IN PTR bar.dns.net.

Just consider the $ORIGIN a suffix to every record. So a

1.101 + 168.192.in-addr.arpa.

becomes

1.101.168.192.in-addr.arpa.

which is exactly 192.168.101.1 in forward notation.

You can leave off the $ORIGIN and write complete entries like this:

1.101.168.192.in-addr.arpa.   IN PTR   cc1.dns.net.

But nobody really likes to type that much. :)

Oh, and of course you want to put the reverse (PTR) records into another DNS zone configured in your /etc/bind/named.conf.local - they do not belong into the same file as the forward (A/CNAME) records.

share|improve this answer
    
Thanks for clearing all this up, I really appreciate the help. –  user1070019 May 22 '12 at 16:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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