Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
o-l-a-v opened this issue Aug 27, 2020 · 2 comments
Open

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

o-l-a-v opened this issue Aug 27, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@o-l-a-v
Copy link

o-l-a-v commented Aug 27, 2020

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
@rhymeswithmogul
Copy link
Owner

I hate to add a dependency on an outside service, but I suppose that's a little better than writing my own Resolve-DnsName. I'll probably implement that, though.

@rhymeswithmogul rhymeswithmogul self-assigned this Jun 1, 2023
@rhymeswithmogul rhymeswithmogul added the enhancement New feature or request label Jun 1, 2023
@rhymeswithmogul
Copy link
Owner

I wrote this code into MailPolicyExplainer. I plan to backport it to Office365DnsChecker when I have some free time.

@rhymeswithmogul rhymeswithmogul added this to the v2.1.0 milestone Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants