Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
Address:     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 - 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

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


zone "" IN { type master; file ""; };
zone "" IN { type master; file ""; };

@       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

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

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

$GENERATE 0-254 $ PTR    for.internal.use.only.
share|improve this answer

Your Answer


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.