Set-DnsServerForwarder

Changes forwarder settings on a DNS server.

Syntax

Set-DnsServerForwarder
   [[-IPAddress] <IPAddress[]>]
   [-AsJob]
   [-CimSession <CimSession[]>]
   [-ComputerName <String>]
   [-Confirm]
   [-EnableReordering <Boolean>]
   [-PassThru]
   [-ThrottleLimit <Int32>]
   [-Timeout <UInt32>]
   [-UseRootHint <Boolean>]
   [-WhatIf]
   [<CommonParameters>]

Description

The Set-DnsServerForwarder cmdlet changes forwarder settings on a Domain Name System (DNS) server. This cmdlet sets or resets IP addresses to which the DNS server forwards DNS queries when it cannot solve them locally. This cmdlet overwrites existing server level forwarders.

Setting IP addresses by using this cmdlet causes the DNS server to perform recursive queries to the DNS servers at the specified IP addresses. By default, the DNS server waits five seconds for a response from one forwarder IP address before it tries another forwarder IP address. You can use the Timeout parameter to change the number of seconds that the DNS server waits. When the server has exhausted all forwarders, it attempts standard recursion. By default, a DNS server performs iterative queries when it cannot resolve a query.

Examples

Example 1: Set a forwarder on a DNS server

PS C:\> Set-DnsServerForwarder -IPAddress "10.0.0.1" -PassThru

This command overwrites the list of existing forwarders on a DNS server and specifies the IP address of a DNS server where queries are forwarded.

Example 2: Disable reordering of forwarders on a DNS server

PS C:\> Set-DnsServerForwarder -EnableReordering $False -PassThru

This command disables dynamic reordering of forwarders on a DNS server.

Optional Parameters

-AsJob

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.

The cmdlet immediately returns an object that represents the job and then displays the command prompt. You can continue to work in the session while the job completes. To manage the job, use the *-Job cmdlets. To get the job results, use the Receive-Job cmdlet.

For more information about Windows PowerShell background jobs, see about_Jobs.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Type:CimSession[]
Aliases:Session
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ComputerName

Specifies a remote DNS server. You can specify an IP address or any value that resolves to an IP address, such as a fully qualified domain name (FQDN), host name, or NETBIOS name.

Type:String
Aliases:Cn
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-EnableReordering

Specifies wheter to enable the DNS server to reorder forwarders dynamically.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-IPAddress

Specifies an array of IP addresses of DNS servers where queries are forwarded. Specify the forwarders in the order that you want them to be configured.

Type:IPAddress[]
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ThrottleLimit

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Timeout

Specifies the number of seconds that the DNS server waits for a response from the forwarder. The minimum value is 0, and the maximum value is 15. The default value is 5.

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-UseRootHint

Specifies whether to prevent the DNS server from performing iterative queries. If you set UseRootHint to $false, the DNS server forwards unresolved queries only to the DNS servers in the forwarders list and does not try iterative queries if the forwarders do not resolve the queries.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Class DNSForwarderSettings

{

uint32 ForwardDelegations; // Specifies whether the DNS server forwards queries to delegated subzones.

DNSForwarders Forwarders[]; //Enumerates the list of IP addresses of forwarders to which the DNS server forwards queries.

uint32 ForwardingTimeout; // Time, in seconds, that a DNS server that is forwarding a query will wait for resolution from the forwarder before it attempts to resolve the query itself. This value is meaningless if the forwarding server is not set to use recursion. To determine this, check the IsSlave Boolean property.

boolean IsSlave; //True if the DNS server does not use recursion when name resolution through forwarders fails.

}

Outputs

Microsoft.Management.Infrastructure.CimInstance#DnsServerForwarder