Skip to content

Feature request - Use Google DNS API for looking up DNS records #2

@o-l-a-v

Description

@o-l-a-v

Using Google DNS API for looking up DNS records might help speed up the code, plus it will truly be multi platform.

Example

## Domain
$Domain = '<some_domain>'

## Uri
### All
$Uri = 'https://dns.google.com/resolve?name={0}&type=all' -f $Domain
### A
$Uri = 'https://dns.google.com/resolve?name={0}&type=a' -f $Domain
### MX
$Uri = 'https://dns.google.com/resolve?name={0}&type=mx' -f $Domain
### TXT
$Uri = 'https://dns.google.com/resolve?name={0}&type=txt' -f $Domain

## Request
(Invoke-RestMethod -Uri $URI -Method 'Get').'Answer'

## AIO SPF
([array]((Invoke-RestMethod -Uri ('https://dns.google.com/resolve?name={0}&type=txt' -f $Domain) -Method 'Get').'Answer'.Where{$_.'data' -like '"v=spf1*'})).'Count' -gt 0

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions