Skip to content

Commit

Permalink
When scanning interfaces with WMI, include networks without a domain. (
Browse files Browse the repository at this point in the history
…#999)

* When scanning interfaces with WMI, include networks without a domain.

* Ignore networks found via wmi that have no nameservers

---------

Co-authored-by: Me <[email protected]>
  • Loading branch information
noopbug and Me authored Nov 1, 2023
1 parent 7bd3df6 commit defa13e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dns/win32util.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ def run(self):
try:
system = wmi.WMI()
for interface in system.Win32_NetworkAdapterConfiguration():
if interface.IPEnabled and interface.DNSDomain:
self.info.domain = _config_domain(interface.DNSDomain)
if interface.IPEnabled and interface.DNSServerSearchOrder:
self.info.nameservers = list(interface.DNSServerSearchOrder)
if interface.DNSDomain:
self.info.domain = _config_domain(interface.DNSDomain)
if interface.DNSDomainSuffixSearchOrder:
self.info.search = [
_config_domain(x)
Expand Down

0 comments on commit defa13e

Please sign in to comment.