My site is ad supported.

DNS Records to HTML Page Export (Script)

Version 1.0 - Download


Description

Reads all active DNS zones on the Windows DNS service and builds an HTML page for viewing the zone files via the web.

This is a much improved version of my earlier script which was featured on How-To Geek: How to Export Your Windows Server's DNS Records to a Web Page.

Requirements:

  • DnsCmd.exe

Examples

The following command outputs the DNS information to the folder named "dns" under the default IIS web root with the page title set to "NS1" (the default page name is used):

DnsHtmlExport C:\inetpub\wwwroot\dns /T NS1
The following command outputs the DNS information to the folder "C:\web files\dns records" using an index file with the name "index.html" and a title of "DNS Records":
DnsHtmlExport "C:\web files\dns records" /T "DNS Records" /P index.html


My site is ad supported.

Help Information (/?)

DnsHtmlExport OutputPath [/T HtmlPageTitle] [/P HtmlIndexFileName]

 OutputPath
          Location to create the HTML index page and exported DNS zone files.
          The directory specified should already exist.
 /T HtmlPageTitle
          Page title to use for the generated HTML page.
          Default value is: [ComputerName] DNS Records
 /P HtmlIndexFileName
          File name to be used for the generated HTML page.
          Default value is: default.htm

Notes:
 - DNS zones are exported in .txt format using DnsCmd /ZoneExport.
   This produces a "true" export file which can be used to rebuild zones.
 - The DnsCmd /ZoneExport function creates a subfolder in the root DNS
   Windows folder. The created folder is cleaned up by this utility, however
   the account which executes this command must have permissions to modify
   files in this location.