sometimes when migrating the domain from one domain to a new domain , you have to export all the DNS records from the source domain and import them into the target domain.
Here is a quick way of doing it:
Part A – Export the DNS records from the source server.
on the source DNS server
1.open DNS managment.
2.right click on the relevant zone->export list
3.save the file , and copy it to the target server.
The output should look like this
in this example i would want to export only the static DNS records, so i will filter column D and leave only the static records.
Part B – Import the static entries into the target server
1.We will use DNSCMD to import the DNS entries we exported in Part A.
2.Open the file you saved in step A, in Excel
3.Delete any of the rows that you dont need – i left only the static entries.
4.Right click on Colum A and choose “Insert”.
5.Enter DNSCMD in A1 cell and copy it all the way down.
6.Right-click on Column B and choose “Insert”
7.Enter the target DNS Server’s name/FQDN/IP on cell B1 and copy it all the way down
8.Right-click on Column C and choose“Insert”
9.Enter ‘/recordadd on cell C1 and copy it all the way down (need the apostrophe otherwise excel will get angry about the /)
10.Right-click on Column D and choose “Insert”
11.Enter the zone name on cell D1 and copy it all the way down
12.Sort the sheet by column F and change the records on this column to the type you need.
13.replace Host(A) -> A
14.delete column H.
15.save the file as a CSV file and open it on notepad
16.Save the file as a CSV
17.Do a search-replace on , and replace it with a space
18.save the file as bat file. make sure that there is only a single space between each word:
19.Finally :Use Run as to open a dos command prompt with DNS privilidges in the target domain
one more note:
if you want to copy the records from a sub-zone the syntax should be slightly different, you need to add to the host name a dot with the sub-zone name ,
for example , if i want to add a record for a host named pc01.mysubzone.bb.local , the syntax would be
DNSCMD 192.168.1.22 /recordadd bb.local pc01.mysubzone A 10.150.30.17