-
Notifications
You must be signed in to change notification settings - Fork 55
xDnsRecord
Johan Ljunggren edited this page Jul 9, 2021
·
4 revisions
⚠️ DEPRECATED! The resource has been replaced by DnsServerA, DnsServerPtr, and DnsServerCName in the DSC resource module DnsServerDsc.
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Name | Key | String | Specifies the name of the DNS server resource record object. | |
Zone | Key | String | Specifies the name of a DNS zone. | |
Type | Required | String | Specifies the type of DNS record. |
ARecord , CName , Ptr
|
Target | Key | String | Specifies the Target Hostname or IP Address. Only Supports IPv4 in the current release. | |
DnsServer | Write | String | Name of the DnsServer to create the record on. Defaults to 'localhost' . |
|
Ensure | Write | String | Should this DNS resource record be present or absent |
Present , Absent
|
The xDnsRecord DSC resource manages IPv4 host (A), CName, or PTR DNS records against a specific zone on a Domian Name System (DNS) server.
This configuration will manage a DNS A record
Configuration xDnsRecord_ARecord_config
{
Import-DscResource -ModuleName 'xDnsServer'
Node localhost
{
xDnsRecord 'TestRecord'
{
Name = 'testArecord'
Target = '192.168.0.123'
Zone = 'contoso.com'
Type = 'ARecord'
Ensure = 'Present'
}
}
}
This configuration will manage a pair of round-robin DNS A records
Configuration xDnsRecord_RoundRobin_config
{
Import-DscResource -ModuleName 'xDnsServer'
Node localhost
{
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'
}
}
}
This configuration will manage a DNS CName record
Configuration xDnsRecord_CName_config
{
Import-DscResource -ModuleName 'xDnsServer'
Node localhost
{
xDnsRecord 'TestCNameRecord'
{
Name = 'testCName'
Target = 'test.contoso.com'
Zone = 'contoso.com'
Type = 'CName'
Ensure = 'Present'
}
}
}
This configuration will manage a DNS PTR record
Configuration xDnsRecord_PTR_config
{
Import-DscResource -ModuleName 'xDnsServer'
Node localhost
{
xDnsRecord 'TestPtrRecord'
{
Name = '123'
Target = 'TestA.contoso.com'
Zone = '0.168.192.in-addr.arpa'
Type = 'PTR'
Ensure = 'Present'
}
}
}
This configuration will remove a DNS A record
Configuration xDnsRecord_ARecordRemove_config
{
Import-DscResource -ModuleName 'xDnsServer'
Node localhost
{
xDnsRecord 'RemoveTestRecord'
{
Name = 'testArecord'
Target = '192.168.0.123'
Zone = 'contoso.com'
Type = 'ARecord'
Ensure = 'Absent'
}
}
}
- DnsRecordA
- DnsRecordAaaa
- DnsRecordAaaaScoped
- DnsRecordAScoped
- DnsRecordCname
- DnsRecordCnameScoped
- DnsRecordMx
- DnsRecordMxScoped
- DnsRecordNs
- DnsRecordNsScoped
- DnsRecordPtr
- DnsRecordSrv
- DnsRecordSrvScoped
- DnsServerADZone
- DnsServerCache
- DnsServerClientSubnet
- DnsServerConditionalForwarder
- DnsServerDiagnostics
- DnsServerDsSetting
- DnsServerEDns
- DnsServerForwarder
- DnsServerPrimaryZone
- DnsServerRecursion
- DnsServerRootHint
- DnsServerScavenging
- DnsServerSecondaryZone
- DnsServerSetting
- DnsServerSettingLegacy
- DnsServerZoneAging
- DnsServerZoneScope
- DnsServerZoneTransfer