Skip to content

xDnsRecordSrv

Johan Ljunggren edited this page Jul 9, 2021 · 2 revisions

xDnsRecordSrv

⚠️ DEPRECATED! The resource has been replaced by DnsRecordSrv in the DSC resource module DnsServerDsc.

Parameters

Parameter Attribute DataType Description Allowed Values
Zone Key String Specifies the name of a DNS zone.
SymbolicName Key String Service name for the SRV record. eg: xmpp, ldap, etc.
Protocol Key String Service transmission protocol ('TCP' or 'UDP') TCP, UDP
Port Key UInt16 The TCP or UDP port on which the service is found
Target Key String Specifies the Target Hostname for the SRV record
Priority Required UInt16 Specifies the Priority value of the SRV record.
Weight Required UInt16 Specifies the Weight value of the SRV record.
TTL Write String Specifies the TTL value of the SRV record. Value must be in valid TimeSpan format.
DnsServer Write String Name of the DnsServer to create the record on.
Ensure Write String Should this DNS resource record be present or absent Present, Absent

Description

The xDnsRecordSrv DSC resource manages SRV DNS records against a specific zone on a Domain Name System (DNS) server.

Examples

Example 1

This configuration will ensure a DNS SRV record exists for XMPP that points to chat.contoso.com with a priority of 10, weight of 20 and default TTL of 1 hour.

Configuration xDnsRecordSrv_config
{
    Import-DscResource -ModuleName 'xDnsServer'

    Node localhost
    {
        xDnsRecordSrv 'TestRecord'
        {
            Zone         = 'contoso.com'
            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 for XMPP that points to chat.contoso.com with a priority of 20, weight of 50 and TTL of 5 hours.

Configuration xDnsRecordSrv_full_config
{
    Import-DscResource -ModuleName 'xDnsServer'

    Node localhost
    {
        xDnsRecordSrv 'TestRecord Full'
        {
            Zone         = 'contoso.com'
            SymbolicName = 'xmpp'
            Protocol     = 'tcp'
            Port         = 5222
            Target       = 'chat.contoso.com'
            Priority     = 20
            Weight       = 50
            TTL          = '05:00:00'
            Ensure       = 'Present'
        }
    }
}

Example 3

This configuration will remove a specified DNS SRV record. Note that Priority and Weight are mandatory attributes, but their values are not used to determine which record to remove.

Configuration xDnsRecordSrv_Remove_config
{
    Import-DscResource -ModuleName 'xDnsServer'

    Node localhost
    {
        xDnsRecordSrv 'RemoveTestRecord'
        {
            Zone         = 'contoso.com'
            SymbolicName = 'xmpp'
            Protocol     = 'tcp'
            Port         = 5222
            Target       = 'chat.contoso.com'
            Priority     = 0
            Weight       = 0
            Ensure       = 'Absent'
        }
    }
}
Clone this wiki locally