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 trying to reverse map a block of IP using PTR record to some special name so their usage can be easily reflected by a simple nslookup.

For example, here's a nslookup result:

# nslookup 172.17.201.101
Server:         10.253.33.1
Address:        10.253.33.1#53

101.201.17.172.in-addr.arpa     name = for.internal.use.only.

And I learned that I can add PTR record for a /24 block by using $GENERATE directive

$GENERATE 0-254    $.201.17.172    PTR    for.internal.use.only.

So here's the question:

  1. Am I doing right exposing infomation of IP address by adding PTR record? Any better idea?
  2. If the question above is YES, then how to add PTR record for a /16 IP range? I know I can write 255 lines of $GENTERATE directive but any better solution?
share|improve this question
1  
bind9.net/manual/bind/9.3.2/Bv9ARM.ch06.html#id2566761 - ...is used to create a series of resource records that only differ from each other by an iterator. - looks like $GENERATE won't be enough to do what you want as it is more complex than a simple iterater, but I'll let someone who actually knows more about it than me give the final word –  Mark Henderson May 31 '11 at 5:56
add comment

2 Answers 2

If all the entries are the same, you could probably use one zone file with one $GENERATE for all zones.

named.conf:

zone "1.168.192.in-addr.arpa" IN { type master; file "for-internal-use-ptr.zone"; };
zone "2.168.192.in-addr.arpa" IN { type master; file "for-internal-use-ptr.zone"; };
...

for-internal-use-ptr.zone:

$TTL 1D
@       IN      SOA     ns.your-domain. root.ns.your-domain.  (
                                      1          ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      ns1.your-domain.
              IN      NS      ns2.your-domain.

$GENERATE 0-254 $ PTR    for.internal.use.only.
share|improve this answer
    
A better solution compare to mine :-) –  yegle May 31 '11 at 12:17
add comment

You can use the $ORIGIN variable in your ptr zone file. Here is an example.

$ORIGIN 1.168.192.in-addr.arpa.
$GENERATE 0-254 $ PTR    for.internal.use.only.

$ORIGIN 2.168.192.in-addr.arpa.
$GENERATE 0-254 $ PTR    for.internal.use.only.
share|improve this answer
add comment

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.