-
Notifications
You must be signed in to change notification settings - Fork 55
DnsRecordCname
dscbot edited this page Aug 19, 2024
·
3 revisions
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
ZoneName | Key | System.String | Specifies the name of a DNS zone. (Key Parameter) | |
TimeToLive | Write | System.String | Specifies the TimeToLive value of the SRV record. Value must be in valid TimeSpan string format (i.e.: Days.Hours:Minutes:Seconds.Miliseconds or 30.23:59:59.999). | |
Ensure | Write | Ensure | Whether the host record should be present or removed. | |
Name | Key | System.String | Specifies the name of a DNS server resource record object. (Key Parameter) | |
HostNameAlias | Key | System.String | Specifies a a canonical name target for a CNAME record. This must be a fully qualified domain name (FQDN). (Key Parameter) |
The DnsRecordCname DSC resource manages CNAME DNS records against a specific zone on a Domain Name System (DNS) server.
This configuration will ensure a DNS CNAME record exists when only the mandatory properties are specified.
Configuration DnsRecordCname_Mandatory_config
{
Import-DscResource -ModuleName 'DnsServerDsc'
Node localhost
{
DnsRecordCname 'TestRecord'
{
ZoneName = 'contoso.com'
Name = 'bar'
HostNameAlias = 'quarks.contoso.com'
Ensure = 'Present'
}
}
}
This configuration will ensure a DNS CNAME record exists when all properties are specified.
Configuration DnsRecordCname_Full_config
{
Import-DscResource -ModuleName 'DnsServerDsc'
Node localhost
{
DnsRecordCname 'TestRecord'
{
ZoneName = 'contoso.com'
Name = 'bar'
HostNameAlias = 'quarks.contoso.com'
TimeToLive = '01:00:00'
DnsServer = 'localhost'
Ensure = 'Present'
}
}
}
This configuration will ensure a DNS CNAME record does not exist when mandatory properties are specified.
Configuration DnsRecordCname_Remove_config
{
Import-DscResource -ModuleName 'DnsServerDsc'
Node localhost
{
DnsRecordCname 'TestRecord'
{
ZoneName = 'contoso.com'
Name = 'bar'
HostNameAlias = 'quarks.contoso.com'
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