O'Reilly logo

DNS on Windows 2000, Second Edition by Cricket Liu, Matt Larson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Step 3: Change the Zone Data File Naming Convention

This step is optional. Chances are, your BIND zone data files don’t follow the same naming convention used by the Microsoft DNS Server. Recall from Chapter 4 that the Microsoft convention is the name of the zone followed by the .dns extension—for example, movie.edu.dns. You can continue to use your current naming convention, but if you add new zones with the DNS console, they’ll have the .dns extensions unless you go out of your way to make the names conform to your scheme. If you’re not particularly attached to your naming scheme and don’t want to fight the DNS console every time you create a new zone, this Perl script will rename your zone data files in the .dns style and modify your named.boot file accordingly:

# name-convert.pl—Convert zone data file naming convention in a BIND # named.boot file to Microsoft *.dns format # die "usage: name-convert.pl path-to-named.boot\n" unless $ARGV[0]; open (BOOTIN, $ARGV[0]) || die "Can't open boot file for reading: $!\n"; open (BOOTOUT, ">boot") || die "Can't open boot file for writing: $!\n"; while (<BOOTIN>) { $dir="$1/" if /^directory\s+(.+).*$/; &changeit (1, $1, $2) if /^primary\s+(.+)\s+(.+)$/; &changeit (2, $1, $5, $2) if /^secondary\s+([\w\.]+)\s+(((\d{1,3}\.){3}\ d{1,3}\s+)+)(.+)$/; &changeit (3, "cache", $1) if /^cache\s+\.\s+(.+)$/; } sub changeit { local ($zonetype, $zonename, $oldfilename, $mastersips) = @_; $newfilename="$zonename.dns"; rename ($dir.$oldfilename, $dir.$newfilename) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required