Set-DnsServerForwarder
Set-DnsServerForwarder is accessible with the help of DnsServer module. To configure DnsServer, go through this link.
Synopsis
Changes forwarder settings on a DNS server.
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
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.
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 whether to enable the DNS server to reorder forwarders dynamically.
Type: | Boolean |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
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 |
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 |
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 |
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 |
Syntax
Set-DnsServerForwarder [[-IPAddress] <IPAddress[]>] [-ComputerName <String>] [-UseRootHint <Boolean>] [-Timeout <UInt32>] [-EnableReordering <Boolean>] [-PassThru] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
—————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.
You can check the Version, CommandType and Source of this cmdlet by giving below command.
Get-Command Set-DnsServerForwarder
You can also read about
- Get-DnsServerForwarder
- Add-DnsServerForwarder
- Remove-DnsServerForwarder
To know more PowerShell cmdlets(Commands) on DnsServer click here