DNS nested $GENERATE directives - is it possible?

0

Is there a way to use the $GENERATE directive, in bind, in a nested fashion?

Like:

$GENERATE.$GENERATE.GENERATE.127 IN PTR localhost

Or:

$GENERATE.$GENERATE.10.in-addr.arpa" { type master; file "db.empty"; };

Ninguém

Posted 2013-07-08T13:03:50.743

Reputation: 23

Answers

0

I can't understand what you're actually wanting to accomplish with nested $GENERATE commands, it's basically a simple auto iteration function, so you can generate things which would otherwise be painful exercises in repetition. PTR records for /24 ranges are prime example, same information repeated 250+ times, just incrementing up by one each row.

NickW

Posted 2013-07-08T13:03:50.743

Reputation: 1 029

What about /16, or even /8, networks? – Ninguém – 2013-07-08T13:34:40.007

In theory you could generate them for larger ranges, but then how would you map them? If you had a range 1.2.3.0/24 if you drop the 0, obviously you're referring to a /24 with 3.2.1.in-addr.arpa, if it was a /16, how would you set up the zone? I've always seen it recommended that you generate (or create) PTR records for /24 ranges because of this sort of assumption (how would you map a /20 for example?). That's the way I did it for the public /21 I administered, 8 separate PTR files. – NickW – 2013-07-08T13:41:44.963

I am trying to avoid my initial situation I described here. I ended up acknowledging that maybe setting everything up in the reverse zone for 10.0.0.0/8 would be the best, but I am still trying to wrap my mind around what should be the ideal/standard/canonical situation. (as I have no real IT background)

– Ninguém – 2013-07-08T13:55:00.533

Well, if they are private, you could actually define a 10.in-addr.arpa, as you will be responsible for that range, and only add in the ranges you need. My recommendations are based on public IPs as those are often controlled and administered by multiple organizations. I'd just do $GENERATE 1-254 $ PTR 10.0.1.$ and drop it in the 10.in-addr.arpa file. – NickW – 2013-07-08T14:09:07.547

ok, but still... no way to nest $GENERATE directives, right? (for the rest of the 10.x.x networks) – Ninguém – 2013-07-08T14:14:46.443

Why bother with the rest of them? If I understood your previous question, the other files are empty, so just generate the sequence for the one(s) you need inside 10.in-addr.arpa, and the other records will be assumed to be under that single file, no need to load up thousands of empty files for no good reason. – NickW – 2013-07-08T14:28:02.550