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

Test-DNSConfiguration is not optimal #58

Open
Xento opened this issue Jan 5, 2021 · 4 comments
Open

Test-DNSConfiguration is not optimal #58

Xento opened this issue Jan 5, 2021 · 4 comments

Comments

@Xento
Copy link

Xento commented Jan 5, 2021

There are some issues with the dns check.
It wont hurt when it detects a false positive but it distorts the reports.

$localIPs:

172.30.x.x
fe80::9578:xy:xy:x
172.29.x.x
fe80::e8a1:xy:xy:x
192.168.x.x
fe80::8c21:xy:xy:x

Resolve-DnsName -Name $fqdn -Server ($dnsServers | Select-Object -First 1) -Type A -DnsOnly | Where-Object -FilterScript {$_.IPAddress}

Name Type TTL Section IPAddress
Hostname.contoso.de A 1200 Answer 172.30.x.x
dns1.contoso.de A 86400 Additional 172.18.x.x
dns2.contoso.de A 3600 Additional 172.17.x.x

  1. IPv6 adresses in $localIPs but only results for IPv4, so the check will always fail
  2. I'm connected via VPN and have a vSwitch installed so this two addresses won't show up in the dns server

May be it would be best to only check the connection with the corrent dns suffix or make it configureable

@ladewig
Copy link
Contributor

ladewig commented Jan 12, 2021

In line 931 of the released code, where it says:

$dnsAddressList = Resolve-DnsName -Name $fqdn -Server ($dnsServers | Select-Object -First 1) -Type A -DnsOnly | Select-Object -ExpandProperty IPAddress

I changed it to be the following with the change in bold and that resolved similar issues we were having.

$dnsAddressList = Resolve-DnsName -Name $fqdn -Server ($dnsServers | Select-Object -First 1) -Type A -DnsOnly | Where-Object {$_.Name -eq $fqdn} | Select-Object -ExpandProperty IPAddress

Had planned to submit this, but it fell through the cracks. If you make this change, does it address your issue?

@Xento
Copy link
Author

Xento commented Jan 13, 2021

Seems to fix the issue.
My DNS Check is now OK with this change.
Maybe this pullrequest is than obsolete #57

@ladewig
Copy link
Contributor

ladewig commented Jan 15, 2021

If I use your change, it doesn't fix the problem we are experiencing with the DNS test, whereas using $FQDN addresses both your problem and mine.

Our issue is that some (but not all) of the DNS servers we use have been configured to provide extra info, and due to organizational structure, we can't change that.

I'll go comment on the pull request.

@VertigoRay
Copy link

Resolve-DnsName needs -ErrorAction Stop to be properly caught in the event that DNS is unable to resolve anything.

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