The xDnsServer DSC resources configure and manage a DNS server.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Please check out common DSC Resources contributing guidelines.
- xDnsServerForwarder sets a DNS forwarder on a given DNS server.
- xDnsServerADZone sets an AD integrated zone on a given DNS server.
- xDnsServerPrimaryZone sets a standalone Primary zone on a given DNS server.
- xDnsServerSecondaryZone sets a Secondary zone on a given DNS server.
- Secondary zones allow client machine in primary DNS zones to do DNS resolution of machines in the secondary DNS zone.
- xDnsServerZoneTransfer This resource allows a DNS Server zone data to be replicated to another DNS server.
- xDnsRecord This resource allows for the creation of IPv4 host (A) records or CNames against a specific zone on the DNS server
- IsSingleInstance: Specifies the resource is a single instance, the value must be 'Yes'
- IPAddresses: IP addresses of the forwarders
- Name: Name of the AD DNS zone
- Ensure: Whether the AD zone should be present or removed
- DynamicUpdate: AD zone dynamic DNS update option.
- If not specified, defaults to 'Secure'.
- Valid values include: { None | NonsecureAndSecure | Secure }
- ReplicationScope: AD zone replication scope option.
- Valid values include: { Custom | Domain | Forest | Legacy }
- DirectoryPartitionName: Name of the directory partition on which to store the zone.
- Use this parameter when the ReplicationScope parameter has a value of Custom.
- ComputerName: Specifies a DNS server.
- If you do not specify this parameter, the command runs on the local system.
- Credential: Specifies the credential to use to create the AD zone.
- If you do not specify this parameter, the command runs as the local system.
- Name: Name of the primary DNS zone
- ZoneFile: Name of the primary DNS zone file.
- If not specified, defaults to 'ZoneName.dns'.
- Ensure: Whether the primary zone should be present or removed
- DynamicUpdate: Primary zone dynamic DNS update option.
- If not specified, defaults to 'None'.
- Valid values include: { None | NonsecureAndSecure }
- Name: Name of the secondary zone
- MasterServers: IP address or DNS name of the secondary DNS servers
- Ensure: Whether the secondary zone should be present or removed
- Type: Type of the DNS server zone
- Name: Name of the DNS zone
- Type: Type of transfer allowed.
- Values include: { None | Any | Named | Specific }
- SecondaryServer: IP address or DNS name of DNS servers where zone information can be transfered.
- Name: Name of the host
- Zone: The name of the zone to create the host record in
- Target: Target Hostname or IP Address {Only Supports IPv4 in the current release}
- Ensure: Whether the host record should be present or removed
- Name: Name of the host
- Zone: The name of the zone to create the host record in
- Target: Target Hostname or IP Address {Only Supports IPv4 in the current release}
- DnsServer: Name of the DnsServer to create the record on.
- If not specified, defaults to 'localhost'.
- Type: DNS Record Type.
- Values include: { ARecord | CName }
- Ensure: Whether the host record should be present or removed
- MSFT_xDnsRecord: Added DnsServer property
- Converted AppVeyor.yml to pull Pester from PSGallery instead of Chocolatey
- Fixed bug in xDnsServerADZone causing Get-TargetResource to fail with an extra property.
- Unit tests updated to use standard unit test templates.
- MSFT_xDnsServerZoneTransfer: Added unit tests. Updated to meet Style Guidelines.
- MSFT_xDnsARecord: Removed hard coding of Localhost computer name to eliminate PSSA rule violation.
- Added Resource xDnsServerForwarder.
- Updated README.md with documentation and examples for xDnsServerForwarder resource.
- Added Resource xDnsServerADZone that sets an AD integrated DNS zone.
- Updated README.md with documentation and examples for xDnsServerADZone resource.
- Fixed bug in xDnsRecord causing Test-TargetResource to fail with multiple (round-robin) entries.
- Updated README.md with example DNS round-robin configuration.
- Added Resource xDnsRecord with support for CNames.
- This will replace xDnsARecord in a future release.
- Added xDnsServerPrimaryZone resource
- Added support for removing DNS A records
- Fix to retrieving settings for record data
- Removed UTF8 BOM from MOF schema
- Add xDnsARecord resource.
- Initial release with the following resources
- xDnsServerSecondaryZone
- xDnsServerZoneTransfer
configuration Sample_Set_Forwarders
{
Import-DscResource -module xDnsServer
xDnsServerForwarder SetForwarders
{
IsSingleInstance = 'Yes'
IPAddresses = '192.168.0.10','192.168.0.11'
}
}
Sample_Set_Forwarders
configuration Sample_Remove_All_Forwarders
{
Import-DscResource -module xDnsServer
xDnsServerForwarder RemoveAllForwarders
{
IsSingleInstance = 'Yes'
IPAddresses = @()
}
}
Sample_Remove_All_Forwarders
configuration Sample_xDnsServerForwardADZone
{
param
(
[pscredential]$Credential,
)
Import-DscResource -module xDnsServer
xDnsServerADZone addForwardADZone
{
Name = 'MyDomainName.com'
DynamicUpdate = 'Secure'
ReplicationScope = 'Forest'
ComputerName = 'MyDnsServer.MyDomain.com'
Credential = $Credential
Ensure = 'Present'
}
}
Sample_xDnsServerForwardADZone -Credential (Get-Credential)
configuration Sample_xDnsServerReverseADZone
{
Import-DscResource -module xDnsServer
xDnsServerADZone addReverseADZone
{
Name = '1.168.192.in-addr.arpa'
DynamicUpdate = 'Secure'
ReplicationScope = 'Forest'
Ensure = 'Present'
}
}
Sample_xDnsServerReverseADZone
configuration Sample_xDnsServerZoneTransfer_TransferToAnyServer
{
param
(
[Parameter(Mandatory)]
[String]$DnsZoneName,
[Parameter(Mandatory)]
[String]$TransferType
)
Import-DscResource -module xDnsServer
xDnsServerZoneTransfer TransferToAnyServer
{
Name = $DnsZoneName
Type = $TransferType
}
}
Sample_xDnsServerZoneTransfer_TransferToAnyServer -DnsZoneName 'demo.contoso.com' -TransferType 'Any'
configuration Sample_xDnsServerPrimaryZone
{
param
(
[Parameter(Mandatory)]
[String]$ZoneName,
[Parameter()] [ValidateNotNullOrEmpty()]
[String]$ZoneFile = "$ZoneName.dns",
[Parameter()] [ValidateSet('None','NonsecureAndSecure')]
[String]$DynamicUpdate = 'None'
)
Import-DscResource -module xDnsServer
xDnsServerPrimaryZone addPrimaryZone
{
Ensure = 'Present'
Name = $ZoneName
ZoneFile = $ZoneFile
DynamicUpdate = $DynamicUpdate
}
}
Sample_xDnsServerPrimaryZone -ZoneName 'demo.contoso.com' -DyanmicUpdate 'NonsecureAndSecure'
configuration Sample_xDnsServerSecondaryZone
{
param
(
[Parameter(Mandatory)]
[String]$ZoneName,
[Parameter(Mandatory)]
[String[]]$SecondaryDnsServer
)
Import-DscResource -module xDnsServer
xDnsServerSecondaryZone sec
{
Ensure = 'Present'
Name = $ZoneName
MasterServers = $SecondaryDnsServer
}
}
Sample_xDnsServerSecondaryZone -ZoneName 'demo.contoso.com' -SecondaryDnsServer '192.168.10.2'
configuration Sample_Arecord
{
Import-DscResource -module xDnsServer
xDnsRecord TestRecord
{
Name = "testArecord"
Target = "192.168.0.123"
Zone = "contoso.com"
Type = "ARecord"
Ensure = "Present"
}
}
Sample_Arecord
configuration Sample_RoundRobin_Arecord
{
Import-DscResource -module xDnsServer
xDnsRecord TestRecord1
{
Name = "testArecord"
Target = "192.168.0.123"
Zone = "contoso.com"
Type = "ARecord"
Ensure = "Present"
}
xDnsRecord TestRecord2
{
Name = "testArecord"
Target = "192.168.0.124"
Zone = "contoso.com"
Type = "ARecord"
Ensure = "Present"
}
}
Sample_RoundRobin_Arecord
configuration Sample_CName
{
Import-DscResource -module xDnsServer
xDnsRecord TestRecord
{
Name = "testCName"
Target = "test.contoso.com"
Zone = "contoso.com"
Type = "CName"
Ensure = "Present"
}
}
Sample_Crecord
configuration Sample_Remove_Record
{
Import-DscResource -module xDnsServer
xDnsARecord RemoveTestRecord
{
Name = "testArecord"
Target = "192.168.0.123"
Zone = "contoso.com"
Type = "ARecord"
Ensure = "Absent"
}
}
Sample_Sample_Remove_Record