Skip to content

xDnsRecordMx

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

xDnsRecordMx

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

Parameters

Parameter Attribute DataType Description Allowed Values
Name Key String Specifies the name of the DNS server resource record object. For records in the apex of the domain, use a period.
Zone Key String Specifies the name of a DNS zone.
Target Key String Specifies the Target Hostname or IP Address.
Priority Required UInt16 Specifies the Priority value of the MX record.
TTL Write String Specifies the TTL value of the MX 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 xDnsRecordMx DSC resource manages MX DNS records against a specific zone on a Domian Name System (DNS) server.

Examples

Example 1

This configuration will manage a DNS MX record

Configuration xDnsRecordMx_config
{
    Import-DscResource -ModuleName 'xDnsServer'

    Node localhost
    {
        xDnsRecordMx 'TestRecord'
        {
            Name       = '@'
            Target     = 'mail.contoso.com.'
            Zone       = 'contoso.com'
            Priority   = 10
            TTL        = '01:00:00'
            Ensure     = 'Present'
        }
    }
}

Example 2

This configuration will remove a DNS MX record

Configuration xDnsRecordMx_Remove_config
{
    Import-DscResource -ModuleName 'xDnsServer'

    Node localhost
    {
        xDnsRecordMx 'RemoveTestRecord'
        {
            Name     = '@'
            Target   = 'mail.contoso.com.'
            Zone     = 'contoso.com'
            Priority = 10
            Ensure   = 'Absent'
        }
    }
}
Clone this wiki locally