$GENERATE directive to autocreate DNS records

Welcome to Linux Screw! If you're new here, you may want to subscribe our RSS feed.

isc bind$GENERATE directive is available in multi platform DNS server BIND since 8.2 version. It helps you to create hundreds or thousands of resource records with one line in zone file.

Nice example is to use $GENERATE in order to make PTR records for certain DNS zone.

Let’s assume that subnet 192.168.0.0/24 is reserved for use by a DHCP server pool, in this case reverse lookup (PTR) records should like dhcp-#.yourdomain.com. (where # is the number from 1 to 254) can be created with the following lines in the zone file:

1 IN PTR dhcp-1.yourdomain.com.
2 IN PTR dhcp-2.yourdomain.com.
...
253 IN PTR dhcp-253.yourdomain.com.
254 IN PTR dhcp-254.yourdomain.com.

or with with single line:

$GENERATE 1-254 $ PTR dhcp-$.yourdomain.com.

Wide explanation of this directive you can find here.

P.S. From Wikipedia for newbies:

A PTR record or pointer record maps an IPv4 address to the canonical name for that host. Setting up a PTR record for a hostname in the in-addr.arpa. domain that corresponds to an IP address implements reverse DNS lookup for that address. For example (at the time of writing), www.icann.net has the IP address 192.0.34.164, but a PTR record maps 164.34.0.192.in-addr.arpa to its canonical name, referrals.icann.org.

 
 
» You might also be interested in the following articles:
Generate strong passwords online and offline
Dump ipcad output into sqlite3
Secure shell (ssh) connection without password
Network Traffic Generator: hping
Detailed Plans for Fedora 9



» Want to stay up to date? Subscribe to our E-MAIL or RSS feed!

5 Responses to “$GENERATE directive to autocreate DNS records”


  1. 1 Mark

    Interesting, if this works it will definitely save a lot of time for me. Thanks.

  2. 2 Alita Vetere

    I’m not that much of a online reader to be honest but your sites really nice, keep it up! I’ll go ahead and bookmark your website to come back later. Cheers

  3. 3 Lissette Summar

    What I have continually told persons is that while looking for a good online electronics store, there are a few aspects that you have to take into consideration. First and foremost, you need to make sure to locate a reputable and reliable store that has obtained great opinions and scores from other consumers and business world analysts. This will make certain you are getting along with a well-known store that provides good support and help to their patrons. Many thanks sharing your opinions on this blog site.

  4. 4 dell inspiron 17r review

    Hey there, You have done a great job. I will definitely digg it and personally recommend to my friends. I am sure they’ll be benefited from this web site.

  5. 5 dell studio xps 8300 review

    Pretty section of content. I just stumbled upon your weblog and in accession capital to assert that I get in fact enjoyed account your blog posts. Any way I¡¯ll be subscribing to your augment and even I achievement you access consistently quickly.

Leave a Reply




Friendly Sites:Who is behind Linux Screw?
GeekyBits³ | Bash Cures Cancer | OMG! Ubuntu!
My SysAd Blog | Web Upd8
ZEPY | Linux config Wiki | Planet Sysadmin
a non-geek's linux notes | Linux Today
TuxArena: The arena of Tux | LinuxAlt.Com
My name is Artem N. (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››