Skip to main content
Version: 2.1.0

Resolve-SPFRecord

SYNOPSIS

Returns a list of all IP addresses from an SPF record.

SYNTAX

Resolve-SPFRecord [-Name] <String> [[-Server] <String>] [-Referrer <String>] [-Visited <String[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

A function to resolve and parse SPF records for a given domain name.

Supported SPF directives and functions include:

  • mx
  • a
  • ip4 und ip6
  • redirect
  • Warning for too many include entries

Not supported:

  • explanation
  • macros

EXAMPLES

EXAMPLE 1

Resolve-SPFRecord microsoft.com

Resolves the SPF record for the domain "microsoft.com" using the default DNS server.

EXAMPLE 2

Resolve-SPFRecord -Name microsoft.com -Server 1.1.1.1

Resolves the SPF record for the domain "microsoft.com" using the specified DNS server.

PARAMETERS

-Name

The domain name to resolve the SPF record for.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Server

The DNS server to use for the query. If not specified, the system's default DNS server will be used.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Referrer

Provide a referrer to build valid objects during recursive calls of the function.

Type: String
Parameter Sets: (All)
Aliases:

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

-Visited

Track visited domains to prevent circular references during recursive calls of the function.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: @()
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

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

OUTPUTS

Resolve-SPFRecord.SPFRecord[]

System.String

NOTES

https://maester.dev/docs/commands/Resolve-SPFRecord

https://cloudbrothers.info/en/powershell-tip-resolve-spf/