code: def _config_win32_fromkey(self, key):
          
          try:
              enable_dhcp, rtype = _winreg.QueryValueEx(key, 'EnableDHCP')
          except WindowsError:
              enable_dhcp = False
          if enable_dhcp:
              try:
                  servers, rtype = _winreg.QueryValueEx(key, 'DhcpNameServer')
              except WindowsError:
                  servers = None
              if servers:
                  self._config_win32_nameservers(servers)
                  try:
                      dom, rtype = _winreg.QueryValueEx(key, 'DhcpDomain')
                      if dom:
                          self._config_win32_domain(servers)
                  except WindowsError:
                      pass
              self._config_win32_add_ifaddr(key, 'DhcpIPAddress')
          else:
              try:
                  servers, rtype = _winreg.QueryValueEx(key, 'NameServer')
              except WindowsError:
                  servers = None
              if servers:
                  self._config_win32_nameservers(servers)
                  try:
                      dom, rtype = _winreg.QueryValueEx(key, 'Domain')
                      if dom:
                          self._config_win32_domain(servers)
                  except WindowsError:
                      pass
              self._config_win32_add_ifaddr(key, 'IPAddress')
          try:
              search, rtype = _winreg.QueryValueEx(key, 'SearchList')
          except WindowsError:
              search = None
          if search:
              self._config_win32_search(search)
docs: Extract DNS info from a registry key.