Table of Contents
Parameters
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| Port | Key | System.UInt16 | The TCP or UDP port on which the service is found (Key Parameter) | |
| Protocol | Key | System.String | Service transmission protocol ('TCP' or 'UDP') (Key Parameter) | TCP, UDP |
| SymbolicName | Key | System.String | Service name for the SRV record. eg: xmpp, ldap, etc. (Key Parameter) | |
| Target | Key | System.String | Specifies the Target Hostname or IP Address. (Key Parameter) | |
| ZoneName | Key | System.String | Specifies the name of a DNS zone. (Key Parameter) | |
| ZoneScope | Key | System.String | Specifies the name of a zone scope. (Key Parameter) | |
| Priority | Required | System.UInt16 | Specifies the Priority value of the SRV record. (Mandatory Parameter) | |
| Weight | Required | System.UInt16 | Specifies the weight of the SRV record. (Mandatory Parameter) | |
| DnsServer | Write | System.String | The host name of the Domain Name System (DNS) server, or use 'localhost' for the current node. Defaults to 'localhost'. |
|
| Ensure | Write | Ensure | Whether the host record should be present or removed. | Present, Absent |
| 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). |
Description
The DnsRecordSrvScoped DSC resource manages SRV DNS records against a specific zone and zone scope on a Domain Name System (DNS) server.
Examples
Example 1
This configuration will ensure a DNS SRV record exists in the external scope for XMPP that points to chat.contoso.com with a priority of 10, weight of 20.
Configuration DnsRecordSrvScoped_config
{
Import-DscResource -ModuleName 'DnsServerDsc'
Node localhost
{
DnsRecordSrvScoped 'TestRecord'
{
ZoneName = 'contoso.com'
ZoneScope = 'external'
SymbolicName = 'xmpp'
Protocol = 'tcp'
Port = 5222
Target = 'chat.contoso.com'
Priority = 10
Weight = 20
Ensure = 'Present'
}
}
}
Example 2
This configuration will ensure a DNS SRV record exists in the external scope for XMPP that points to chat.contoso.com with a priority of 20, weight of 50 and Time To Live of 5 hours.
Configuration DnsRecordSrvScoped_full_config
{
Import-DscResource -ModuleName 'DnsServerDsc'
Node localhost
{
DnsRecordSrvScoped 'TestRecord Full'
{
ZoneName = 'contoso.com'
ZoneScope = 'external'
SymbolicName = 'xmpp'
Protocol = 'tcp'
Port = 5222
Target = 'chat.contoso.com'
Priority = 20
Weight = 50
TimeToLive = '05:00:00'
Ensure = 'Present'
}
}
}
Example 3
This configuration will remove a specified DNS SRV record in the external scope. Note that Priority and Weight are mandatory attributes, but their values are not used to determine which record to remove.
Configuration DnsRecordSrvScoped_Remove_config
{
Import-DscResource -ModuleName 'DnsServerDsc'
Node localhost
{
DnsRecordSrvScoped 'RemoveTestRecord'
{
ZoneName = 'contoso.com'
ZoneScope = 'external'
SymbolicName = 'xmpp'
Protocol = 'tcp'
Port = 5222
Target = 'chat.contoso.com'
Priority = 0
Weight = 0
Ensure = 'Absent'
}
}
}
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Home
Resources
- DnsRecordA
- DnsRecordAaaa
- DnsRecordAaaaScoped
- DnsRecordAScoped
- DnsRecordCname
- DnsRecordCnameScoped
- DnsRecordMx
- DnsRecordMxScoped
- DnsRecordNs
- DnsRecordNsScoped
- DnsRecordPtr
- DnsRecordSrv
- DnsRecordSrvScoped
- DnsRecordTxt
- DnsRecordTxtScoped
- DnsServerADZone
- DnsServerCache
- DnsServerClientSubnet
- DnsServerConditionalForwarder
- DnsServerDiagnostics
- DnsServerDsSetting
- DnsServerEDns
- DnsServerForwarder
- DnsServerPrimaryZone
- DnsServerRecursion
- DnsServerRootHint
- DnsServerScavenging
- DnsServerSecondaryZone
- DnsServerSetting
- DnsServerSettingLegacy
- DnsServerZoneAging
- DnsServerZoneScope
- DnsServerZoneTransfer
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.