Set-DnsServerForwarder

Set-DnsServerForwarder

Changes forwarder settings on a DNS server.

Syntax

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

Detailed 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.

Parameters

-AsJob

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CimSession<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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ComputerName<String>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EnableReordering<Boolean>

Enables the DNS server to reorder forwarders dynamically.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-IPAddress<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.

Aliases

none

Required?

false

Position?

2

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ThrottleLimit<Int32>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Timeout<UInt32>

Sets 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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-UseRootHint<Boolean>

Prevents 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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

-

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

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Management.Infrastructure.CimInstance#DnsServerForwarder

Examples

Example 1: Set a forwarder on a DNS server

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.

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

Example 2: Disable reordering of forwarders on a DNS server

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

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

Get-DnsServerForwarder

Add-DnsServerForwarder

Remove-DnsServerForwarder