| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Jun 6, 2007, at 8:23 PM, Robert Everson wrote:
Hello, What you're looking for isn't really an OS X Server feature, it's a BIND feature. You want a "$GENERATE" statement in your zone file, something like: $GENERATE 2-20 dhcp$ IN A 10.0.1.$ This would create address records named dhcpN, for IP addresses 10.0.1.N, where N is expanded to the range of numbers between 2 and 20 (inclusive). $GENERATE also works within the reverse zone file for PTR records. $GENERATE 2-20 $ IN PTR dhcp$.937. (In this example, my tld is "937"). For more information on this directive, see: http://www.bind9.net/manual/bind/9.3.2/Bv9ARM.ch06.html#id2566761 If you want to retain the ability to use Server Admin to edit your DNS zones, I recommend instead that you use a small script to generate individual record statements which can then be pasted into your zone files. I've written a small sample, included below. Edit AddressPrefix, range, and tld as needed. If you want a different format than that produced by this script, edit inside the foreach loop. ----------script start---------- #!/usr/bin/perl -w use strict; # Place the first three octets here. my $AddressPrefix = "10.0.1"; # Define the range of numbers, inclusive. my $range = "2 .. 10"; # Your fqdn suffix here, e.g. "foo.com" or "k12.fl.us.gov" my $tld = "937"; # Need a backwards representation for PTR records my $octets = join(".", reverse(split(/\./, $AddressPrefix))); # For our resulting address and ptr records my @A, my @PTR = ""; foreach my $n ( eval $range ) { push @A, "dhcp$n IN A $AddressPrefix.$n"; push @PTR, "$n.$octets.in-addr.arpa. IN PTR dhcp$n.$tld."; } print "Forward zone address records:\n"; print "$_\n" for @A; print "\nReverse zone ptr records:"; print "$_\n" for @PTR; ----------script end---------- Example run: {179} root@tiny [~] # ./gen.pl Forward zone address records: dhcp2 IN A 10.0.1.2 dhcp3 IN A 10.0.1.3 dhcp4 IN A 10.0.1.4 dhcp5 IN A 10.0.1.5 dhcp6 IN A 10.0.1.6 dhcp7 IN A 10.0.1.7 dhcp8 IN A 10.0.1.8 dhcp9 IN A 10.0.1.9 dhcp10 IN A 10.0.1.10 Reverse zone ptr records: 2.1.0.10.in-addr.arpa. IN PTR dhcp2.937. 3.1.0.10.in-addr.arpa. IN PTR dhcp3.937. 4.1.0.10.in-addr.arpa. IN PTR dhcp4.937. 5.1.0.10.in-addr.arpa. IN PTR dhcp5.937. 6.1.0.10.in-addr.arpa. IN PTR dhcp6.937. 7.1.0.10.in-addr.arpa. IN PTR dhcp7.937. 8.1.0.10.in-addr.arpa. IN PTR dhcp8.937. 9.1.0.10.in-addr.arpa. IN PTR dhcp9.937. 10.1.0.10.in-addr.arpa. IN PTR dhcp10.937. See the following for a more complex example: http://www.perl.com/pub/a/2002/11/20/dns.html After editing the zone file, restart named by sending it a SIGHUP, e.g. sudo killall -HUP named. Check system.log for errors. HTH, -Andre |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Macos-x-server mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/macos-x-server/email@hidden This email sent to email@hidden
| References: | |
| >Assigning DNS based on DHCP (From: Robert Everson <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.