MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _system_resolvers

Function _system_resolvers

network_diagnostics.py:1042–1050  ·  view source on GitHub ↗

This host's real upstream DNS servers (resolv.conf, or nmcli when only the systemd-resolved stub is present).

()

Source from the content-addressed store, hash-verified

1040 m = _mac_norm(mac)
1041 if not m:
1042 return {'klass': 'invalid', 'vendor': None, 'note': 'not a MAC'}
1043 b0 = _mac_first_octet(m)
1044 prefix6 = m.replace(':', '')[:6]
1045 if b0 & 0x01: # multicast/broadcast — never a valid source address
1046 return {'klass': 'invalid', 'vendor': None, 'note': 'multicast/broadcast'}
1047 if not (b0 & 0x02): # universal — legitimately-registered OUI
1048 vendor = _vendor_for_prefix(prefix6)
1049 return {'klass': 'universal', 'vendor': vendor, 'note': None}
1050 # Locally-administered: virtual, disguised-vendor, or privacy randomization.
1051 for pfx, name in _MAC_VIRTUAL_PREFIXES.items():
1052 if m.startswith(pfx):
1053 return {'klass': 'virtual_laa', 'vendor': name, 'note': 'VM/container NIC'}

Callers 1

do_dns_doctorFunction · 0.85

Calls 2

_read_resolv_confFunction · 0.85
_nmcli_global_valuesFunction · 0.85

Tested by

no test coverage detected