Question : Sync between BIND and Microsoft DNS

Hi all,

I've got a an issue with our DNS configuration due to mistakes which we're made in the past. The situation that I have is that we have a microsoft domain with an external DNS name for example domain.com, this same domain is hosted on our internet facing DNS (BIND).

What I want to configure is a primairy DNS zone on my DC's (AD integrated w. dynamic updates) that retrieves the records from BIND and imports these.

Things I've tried so far:
Syncronize DNS servers: Not possible as both dns servers are hosting a primairy zone and I do not want my internal records to be published on BIND.
Create a script: Do a zone transfer from BIND to windows and do a compare then commit changes. For this i've been trying to script my way out (both batch as well as vbscript) but have not been able to do this.

Please help me get in the right direction to resolve this issue as I do not want to manually update the microsoft DNS if changes occur on BIND.

Thanks in advance!

Answer : Sync between BIND and Microsoft DNS


I have a (free) PowerShell module that can do this kind of thing.

http://code.msdn.microsoft.com/dnsshell

I need to do a few updates to make the easier, it's one of those things I intended it to be able to handle though.

It would go something like this, subject to testing, etc, etc.

Chris
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
$Zone = "domain.com"

Get-Dns $Zone -Transfer | 
    Select-Object -Expand Answer | 
    Where-Object { $_.Type -NotMatch "SOA|NS" } | 
    ForEach-Object {

  # See if the record already exists
  If ((Get-DnsRecord -Name $_.Name -Type $_.RecordType -Zone $Zone) -eq $Null) {
    Switch ($_.Type) {
      "A"     { New-DnsRecord -Name $_.Name -Address $_.IPAddress -RecordType A -Zone $Zone }
      "CNAME" { New-DnsRecord -Name $_.Name -Hostname $_.Hostname -RecordType CNAME -Zone $Zone }
    }
  }
}
Random Solutions  
 
programming4us programming4us