az network dns record-set mx

Manage DNS MX records.

Commands

az network dns record-set mx add-record

Add an MX record.

az network dns record-set mx create

Create an empty MX record set.

az network dns record-set mx delete

Delete an MX record set and all associated records.

az network dns record-set mx list

List all MX record sets in a zone.

az network dns record-set mx remove-record

Remove an MX record from its record set.

az network dns record-set mx show

Get the details of an MX record set.

az network dns record-set mx update

Update an MX record set.

az network dns record-set mx add-record

Add an MX record.

az network dns record-set mx add-record --exchange
                                        --preference
                                        --record-set-name
                                        --resource-group
                                        --zone-name
                                        [--if-none-match]
                                        [--subscription]
                                        [--ttl]

Examples

Add an MX record.

az network dns record-set mx add-record -g MyResourceGroup -z www.mysite.com \
    -n MyRecordSet -e mail.mysite.com -p 10

Required Parameters

--exchange -e

Exchange metric.

--preference -p

Preference metric.

--record-set-name -n

The name of the record set relative to the zone. Creates a new record set if one does not exist.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--zone-name -z

The name of the zone.

Optional Parameters

--if-none-match

Create the record set only if it does not already exist.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--ttl

Record set TTL (time-to-live).

default value: 3600

az network dns record-set mx create

Create an empty MX record set.

az network dns record-set mx create --name
                                    --resource-group
                                    --zone-name
                                    [--if-match]
                                    [--if-none-match]
                                    [--metadata]
                                    [--subscription]
                                    [--target-resource]
                                    [--ttl]

Examples

Create an empty MX record set.

az network dns record-set mx create -g MyResourceGroup -z www.mysite.com -n MyRecordSet

Create an empty MX record set. (autogenerated)

az network dns record-set mx create --name MyRecordSet --resource-group MyResourceGroup --ttl 30 --zone-name www.mysite.com

Required Parameters

--name -n

The name of the record set, relative to the name of the zone.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--zone-name -z

The name of the zone.

Optional Parameters

--if-match

The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwritting any concurrent changes.

--if-none-match

Create the record set only if it does not already exist.

--metadata

Metadata in space-separated key=value pairs. This overwrites any existing metadata.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--target-resource

ID of an Azure resource from which the DNS resource value is taken.

--ttl

Record set TTL (time-to-live).

default value: 3600

az network dns record-set mx delete

Delete an MX record set and all associated records.

az network dns record-set mx delete --name
                                    --resource-group
                                    --zone-name
                                    [--if-match]
                                    [--subscription]
                                    [--yes]

Examples

Delete an MX record set and all associated records.

az network dns record-set mx delete -g MyResourceGroup -z www.mysite.com -n MyRecordSet

Required Parameters

--name -n

The name of the record set, relative to the name of the zone.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--zone-name -z

The name of the zone.

Optional Parameters

--if-match

The etag of the record set. Omit this value to always delete the current record set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

az network dns record-set mx list

List all MX record sets in a zone.

az network dns record-set mx list --resource-group
                                  --zone-name
                                  [--query-examples]
                                  [--subscription]

Examples

List all MX record sets in a zone.

az network dns record-set mx list -g MyResourceGroup -z www.mysite.com

List all MX record sets in a zone (autogenerated)

az network dns record-set mx list --resource-group MyResourceGroup --subscription MySubscription --zone-name www.mysite.com

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--zone-name -z

The name of the zone.

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az network dns record-set mx remove-record

Remove an MX record from its record set.

By default, if the last record in a set is removed, the record set is deleted. To retain the empty record set, include --keep-empty-record-set.

az network dns record-set mx remove-record --exchange
                                           --preference
                                           --record-set-name
                                           --resource-group
                                           --zone-name
                                           [--keep-empty-record-set]
                                           [--subscription]

Examples

Remove an MX record from its record set.

az network dns record-set mx remove-record -g MyResourceGroup -z www.mysite.com \
    -n MyRecordSet -e mail.mysite.com -p 10

Required Parameters

--exchange -e

Exchange metric.

--preference -p

Preference metric.

--record-set-name -n

The name of the record set relative to the zone.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--zone-name -z

The name of the zone.

Optional Parameters

--keep-empty-record-set

Keep the empty record set if the last record is removed.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az network dns record-set mx show

Get the details of an MX record set.

az network dns record-set mx show --name
                                  --resource-group
                                  --zone-name
                                  [--query-examples]
                                  [--subscription]

Examples

Get the details of an MX record set.

az network dns record-set mx show -g MyResourceGroup -z www.mysite.com -n MyRecordSet

Required Parameters

--name -n

The name of the record set, relative to the name of the zone.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--zone-name -z

The name of the zone.

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az network dns record-set mx update

Update an MX record set.

az network dns record-set mx update --name
                                    --resource-group
                                    --zone-name
                                    [--add]
                                    [--force-string]
                                    [--if-match]
                                    [--if-none-match]
                                    [--metadata]
                                    [--remove]
                                    [--set]
                                    [--subscription]
                                    [--target-resource]

Examples

Update an MX record set.

az network dns record-set mx update -g MyResourceGroup -z www.mysite.com \
    -n MyRecordSet --metadata owner=WebTeam

Update an MX record set. (autogenerated)

az network dns record-set mx update --name MyRecordSet --resource-group MyResourceGroup --set tags.CostCenter=MyBusinessGroup --zone-name www.mysite.com

Required Parameters

--name -n

The name of the record set, relative to the name of the zone.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--zone-name -z

The name of the zone.

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

--if-match

The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwritting any concurrent changes.

--if-none-match

Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will be ignored.

--metadata

Metadata in space-separated key=value pairs. This overwrites any existing metadata.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--target-resource

ID of an Azure resource from which the DNS resource value is taken.