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

Invoke-Maester support for custom DNS resolvers #612

Open
moorereason opened this issue Jan 6, 2025 · 5 comments
Open

Invoke-Maester support for custom DNS resolvers #612

moorereason opened this issue Jan 6, 2025 · 5 comments

Comments

@moorereason
Copy link
Contributor

I need to bypass the default DNS resolvers in order to validate Exchange MX/SFP/DKIM records against an external resolver. I would like the ability to do:

Invoke-Maester -DnsServerIpAddress 8.8.8.8

Is this possible today?

@soulemike
Copy link
Contributor

It isn't presented through to the core module today, though the Get-MailAuthenticationRecord command can support it.

It should be possible to add module variable and parameter to Invoke-Maester to set it. Then have the tests reference it when they call for the records.

In the interim though, the local copy of the tests could be modified to add that parameter when they call for the records.

@moorereason
Copy link
Contributor Author

From what I can tell, Invoke-Maester doesn't have any module variables or parameters that get passed down to subsequent commands like this. If I'm missing it, please direct me to existing examples.

If not, what is the preferred design? I'd be willing to work on solving this DNS resolver issue, but I'd like someone from the Maester team to sketch out a proposed API for adding such things to the project.

@soulemike
Copy link
Contributor

There are a couple options:

  1. Add a module parameter and pass that into tests calling Get-MailAuthenticationRecord as a module variable.
  2. Create custom tests for your environment that mirror the built in, but set the parameter on Get-MailAuthenticationRecord for your environment. Such as in https://github.com/maester365/maester/blob/main/powershell/public/cisa/exchange/Test-MtCisaDkim.ps1

Neither is wrong, both can be done concurrently too.

@moorereason
Copy link
Contributor Author

PR submitted to implement option 1.

@tdcthosc
Copy link
Contributor

tdcthosc commented Mar 4, 2025

I have removed the fixed IP address in PR #725 as we should rely on the machines DNS server for now until we support environment variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants