New-AzDnsForwardingRulesetForwardingRule
Create a forwarding rule in a DNS forwarding ruleset.
Syntax
CreateViaIdentityDnsForwardingRulesetExpanded (Default)
New-AzDnsForwardingRulesetForwardingRule
-Name <String>
-DnsForwardingRulesetInputObject <IDnsResolverIdentity>
-DomainName <String>
-TargetDnsServer <ITargetDnsServer[]>
[-IfMatch <String>]
[-IfNoneMatch <String>]
[-ForwardingRuleState <String>]
[-Metadata <Hashtable>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
CreateViaJsonString
New-AzDnsForwardingRulesetForwardingRule
-Name <String>
-DnsForwardingRulesetName <String>
-ResourceGroupName <String>
-JsonString <String>
[-SubscriptionId <String>]
[-IfMatch <String>]
[-IfNoneMatch <String>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
CreateViaJsonFilePath
New-AzDnsForwardingRulesetForwardingRule
-Name <String>
-DnsForwardingRulesetName <String>
-ResourceGroupName <String>
-JsonFilePath <String>
[-SubscriptionId <String>]
[-IfMatch <String>]
[-IfNoneMatch <String>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
CreateExpanded
New-AzDnsForwardingRulesetForwardingRule
-Name <String>
-DnsForwardingRulesetName <String>
-ResourceGroupName <String>
-DomainName <String>
-TargetDnsServer <ITargetDnsServer[]>
[-SubscriptionId <String>]
[-IfMatch <String>]
[-IfNoneMatch <String>]
[-ForwardingRuleState <String>]
[-Metadata <Hashtable>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Create a forwarding rule in a DNS forwarding ruleset.
Examples
Example 1: Create a forwarding rule.
$targetIPConfig = New-AzDnsResolverIPConfigurationObject -PrivateIPAddress 10.0.0.3 -PrivateIPAllocationMethod Dynamic -SubnetId /subscriptions/ea40042d-63d8-4d02-9261-fb31450e6c67/resourceGroups/sampleRG/providers/Microsoft.Network/virtualNetworks/vnet-hub/subnets/test-subnet
New-AzDnsForwardingRulesetForwardingRule -DnsForwardingRulesetName dnsForwardingRuleset -Name sampleForwardingRule -ResourceGroupName sampleRG -TargetDnsServer $targetIPConfig
Name Type Etag
---- ---- ----
sampleForwardingRule Microsoft.Network/dnsForwardingRuleset/forwardingRule "0b008451-0000-0800-0000-60402b960000"
This cmdlet creates a forwarding rule.
Example 2: Create a forwarding rule with tag
$targetIPConfig = New-AzDnsResolverIPConfigurationObject -PrivateIPAddress 10.0.0.3 -PrivateIPAllocationMethod Dynamic -SubnetId /subscriptions/ea40042d-63d8-4d02-9261-fb31450e6c67/resourceGroups/sampleRG/providers/Microsoft.Network/virtualNetworks/vnet-hub/subnets/test-subnet
New-AzDnsForwardingRulesetForwardingRule -DnsForwardingRulesetName dnsForwardingRuleset -Name sampleForwardingRule -ResourceGroupName sampleRG -TargetDnsServer $targetIPConfig -Metadata @{"key0" = "value0"}
Name Type Etag
---- ---- ----
sampleForwardingRule Microsoft.Network/dnsForwardingRuleset/forwardingRule "0b008451-0000-0800-0000-60402b960000"
This cmdlet creates a forwarding rule with tag.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The DefaultProfile parameter is not functional.
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
Parameter properties
Type: PSObject
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzureRMContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Identity Parameter
CreateViaIdentityDnsForwardingRulesetExpanded
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-DnsForwardingRulesetName
The name of the DNS forwarding ruleset.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateViaJsonString
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaJsonFilePath
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateExpanded
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DomainName
The domain name for the forwarding rule.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateViaIdentityDnsForwardingRulesetExpanded
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateExpanded
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ForwardingRuleState
The state of forwarding rule.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateViaIdentityDnsForwardingRulesetExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IfMatch
ETag of the resource.
Omit this value to always overwrite the current resource.
Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IfNoneMatch
Set to '*' to allow a new resource to be created, but to prevent updating an existing resource.
Other values will be ignored.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-JsonFilePath
Path of Json file supplied to the Create operation
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateViaJsonFilePath
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-JsonString
Json string supplied to the Create operation
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateViaJsonString
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Metadata attached to the forwarding rule.
Type: Hashtable
Default value: None
Supports wildcards: False
DontShow: False
CreateViaIdentityDnsForwardingRulesetExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
The name of the forwarding rule.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ForwardingRuleName
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
The name of the resource group.
The name is case insensitive.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateViaJsonString
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaJsonFilePath
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateExpanded
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-SubscriptionId
The ID of the target subscription.
The value must be an UUID.
Parameter properties
Type: String
Default value: (Get-AzContext).Subscription.Id
Supports wildcards: False
DontShow: False
Parameter sets
CreateViaJsonString
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateViaJsonFilePath
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TargetDnsServer
DNS servers to forward the DNS query to.
Parameter properties
Type: ITargetDnsServer [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CreateViaIdentityDnsForwardingRulesetExpanded
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CreateExpanded
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs