Files
PSOPNSenseAPI/docs/cmdlets/Set-OPNSenseDNSForwarding.md
T

2.4 KiB

Set-OPNSenseDNSForwarding

SYNOPSIS

Modifies DNS forwarding settings on an OPNSense firewall.

SYNTAX

Set-OPNSenseDNSForwarding [-Enabled <Boolean>] [-WhatIf] [-Confirm]

DESCRIPTION

The Set-OPNSenseDNSForwarding cmdlet modifies DNS forwarding settings on an OPNSense firewall.

EXAMPLES

Example 1: Enable DNS forwarding

Set-OPNSenseDNSForwarding -Enabled $true

This example enables DNS forwarding on the OPNSense firewall.

Example 2: Disable DNS forwarding

Set-OPNSenseDNSForwarding -Enabled $false

This example disables DNS forwarding on the OPNSense firewall.

PARAMETERS

-Enabled

Whether DNS forwarding is enabled.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

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

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Object

Returns an object representing the modified DNS forwarding settings.

NOTES

This cmdlet requires a connection to an OPNSense firewall. Use Connect-OPNSense to establish a connection. After modifying DNS forwarding settings, the DNS service may need to be restarted for the changes to take effect.

Get-OPNSenseDNSForwarding Get-OPNSenseDNSForwardingHost New-OPNSenseDNSForwardingHost Set-OPNSenseDNSForwardingHost Remove-OPNSenseDNSForwardingHost