4/1/2008 9:15:24 AM

Przemek Radzikowski

permalink [Permalink]

International Careers & Jobs - An international employment directory, reviewing world-wide top job sites

  • Home  ›
  • Articles  ›
  • Migrate BIND-based (UNIX or Linux) DNS to Windows Server 2003 using Notepad

| More

Migrate BIND-based (UNIX or Linux) DNS to Windows Server 2003 using Notepad

You may find yourself in a situation where a Berkeley Internet Name Domain [BIND]-based DNS system, such as those used on many variants of UNIX or Linux, needs to be migrated to a Windows Server 2003-based DNS infrastructure. In such instances, there are a number of approaches you may take in order to achieve a successful migration, this article will describe the Notepad migration (append) method.



Introduction to BIND DNS Migration to Windows AD Integrated DNS

This article assumes that you’re familiar with your BIND (Berkeley Internet Name Domain) server infrastructure and can perform the required actions, or can refer to someone who is skilled in BIND operation without input from this article. This article assumes that you are familiar with the Windows Server 2003 platform; however most of the procedures will be step-by-step so you should be able to follow even if you have very little knowledge.

There are two ways we can migrate BIND-based DNS to Windows Server 2003 DNS:

  1. Manually merge the BIND DNS database file with the Windows Server 2003-based DNS file using Notepad - This article will focus on the procedures to handle this scenario, which may be required if you are not in a position to enable zone transfers on the BIND server, or are trying to work with a static file from a decommissioned server.
  2. Transfer the zone from the BIND server - This approach requires the least amount of configuration and is relatively straightforward. If you are in a position to enable zone transfers on your BIND server this is by far the easiest approach. You can read about it in How to Migrate BIND-based (UNIX or Linux) DNS to Windows Server 2003 using Zone Transfers.

Prerequisite Tasks for Migration

Before we can migrate Berkeley Internet Name Domain (BIND)-based DNS from another server, we firstly need to install the DNS services on the Windows Server 2003 machine.  The procedures to install DNS have been covered in one of our previous articles, please reffer to to How to Install and configure a Windows Server 2003-based DNS Service.

Manually merge the BIND DNS database file with the Windows Server 2003-based DNS file using Notepad

If your server is also a Domain Controller, by default DNS is installed using the Active Directory Integrated mode. That is, the DNS information is stored within AD and replicated to other Domain Controllers. If this is the case, we must ensure that we temporarily unbind the storage of DNS from AD and ensure that the DNS database is stored as a simple text file within the C:\WINDOWS\system32\dns folder

Un-integrate the DNS zone from Active Directory


  1. On your Windows Server 2003 DNS server open the DNS management console, by clicking Start > Run... > in the Open textbox type and click OK. The DNS MMC should open. 
  2. Expand Forward Lookup Zones 

  3. Right click the zone you wish to un-integrate from AD and select Properties 
  4. On the General tab, click the Change button next to the Type field. 

  5. Uncheck the Store the zone in Active Directory (Available only if DNS server is a domain controller). 

  6. Click OK 

Backup your tmp.local zone file

In case there are any errors with the migration we would want to roll back the DNS server to its original configuration. We should first backup the DNS database for the zone we wish to import.  The following steps outline this procedure:

  1. Navigate to c:\windows\system32\dns 
  2. You should find a file called tmp.local.dns. This file is a text version of your DNS database and we need to back it up in case we need to restore it in the future. 
  3. We need to stop the DNS service before we can work on the database. To stop the DNS service, in the command prompt window type net stop dns 
  4. Select the tmp.local.dns file 
  5. Press CTRL-C and then CTRL-V 
  6. A copy of tmp.local.dns should have been created in the folder

Obtain a text-based BIND database file from the existing server 

  1. Copy the BIND database file from teh existing server
  2. Ask the BIND-based DNS systems administrator to provide you with the file

Cleanup the BIND file


We must now cleanup the BIND file of any non Windows DNS entries and special characters. These can potentially cause numerous errors during the import procedure.

A typical BIND DNS file would look like this:

$TTL 6h
@	IN SOA __HOSTNAME__ tmp.local. (
		2008030300	; Serial
		3h		; Refresh
		1h		; Retry
		1w		; Expire
		3h )		; Negative cache TTL
			IN NS ns1.tmp.local.
			IN NS ns2.tmp.local.
server 1	30m IN A
server2		30m IN A 
www.server3	1h IN CNAME	webhost 
  1. Open the BIND database file using either Notepad.exe or WordPad.exe (or your favourite text editor). The most common problems are which exist with this type of import are those related to time to live (TTL). For example you may find entries such as:


    server 1	30m IN A
    server2		30m IN A 
    www.server3	1h IN CNAME	webhost 

    Before you can successfully import this file, you need to delete the TTL entries. Simply remove the 30m or 1h or other variants of time you encounter. The screen capture demonstrates the entries: 


  2. Next we need to clean up the header information in your BIND DNS file. Actually, we need to remove all references to the BIND DNS servers which are included in the header. To clean the header delete at the start of the file stopping only before the first DNS entry. As in the following example image, you can safely delete the selected text.


    Save your changes.

Merge the updated and cleaned BIND file with Windows-based DNS file

  1. Open your newly created tmp.local.dns file in notepad.
  2. In another notepad instance or WordPad window, open the cleaned BIND file,
  3. Select the full contents of the cleaned BIND file and copy it to the clipboard.
  4. Change into the tmp.local.dns notepad window (your Windows DNS database file) and append (paste) the contents of the clipboard to the bottom of the file.
  5. Save the file
  6. Start the DNS service, by running net start dns in the command window.

Review the Event Log for import errors and warnings 

At this stage you should go into the event log viewer and inspect the DNS logs for any import errors. Click on Start> Run and type eventvwr.msc and click OK. When the event viewer opens, navigate to the DNS events branch.


When DNS service starts, it parses the database file and loads it into memory. Some errors may be encountered and these will show in the event log. For instance:



If there are any erroneous entries, instead of failing completely, the service ignores the erroneous lines. It is quite important to ensure that you don’t have any errors in the DNS Event Log if you don’t check it, you may be missing critical entries in your DNS and the migration will not be successful.


This article has shown how we can easily migrate BIND based DNS from unix or Linux to a Windows Server based AD-Integrated DNS configuration.


permalink [Permalink] - Updated: Monday, October 28, 2013

| More


Articles of Interest

International Careers & Jobs - An international employment directory, reviewing world-wide top job sites

(c) Capitalhead Pty Ltd
Contact Capitalhead About Us Articles & Publications Partners Solutions & Services Products Valid XHTML Valid CSS