Proposal for "File_DNS"

» Metadata » Status
» Description
The File::DNS class provides a way to read, edit and save RFC1033 style DNS Zones.
These files, usually called Zonefiles, are used by most nameservers, including BIND, to store information about a Domain.
This package makes it possible to address such files in a complete OO way:
Example:

<?php
include_once("File/DNS.php");
$zoneFile = new File_DNS;
$zoneFile->load('example.com.txt', 'example.com');
$zoneFile->delRecord('www1');
$zoneFile->addRecord('www2', 'A', '1.2.3.4');
$zoneFile->addRecord('www3', 'A', '1.2.3.5');
$zoneFile->setMXPref('10', 'mail.example.com');
$zoneFile->setMXPref('20', 'relay1.example.com');
$zoneFile->setMXPref('20', 'relay2.example.com');
$zoneFile->save();
$text = $zoneFile->toString();
print($text);
?>


The package is currently completely documented with docblooks, and has numerous inline comments.
It's able to parse any and all zonefiles I've thrown at it.

It's uses are numerous:

  1. Create CLI or Web-apps to manage your zonefiles without using a DB.
  2. Dynamicly generate subdomains for say, simple hosting accounts.
  3. Clean up messy hand-edited zonefiles.
  4. Validate submitted zonefiles.
» Dependencies » Links
  • File
  • PEAR
» Timeline » Changelog
  • First Draft: 2004-04-14
  • Proposal: 2004-06-12
  • Call for Votes: 2004-06-20