shadow1ng/fscan · error

no IPv4 found

Error message

no IPv4 found

What it means

resolveIPv4 looks up the DC host's IP addresses and returns the first IPv4 address; when the resolver returns addresses but none is IPv4 (only IPv6, or an empty/failed lookup path), it returns "no IPv4 found". It's used as a fallback so LDAP can dial by raw IP instead of hostname.

Source

Thrown at plugins/local/systeminfo_dc_windows.go:231

	p.log("systeminfo_dc_gpos", len(sr.Entries))
	for _, e := range sr.Entries {
		if name := e.GetAttributeValue("displayName"); name != "" {
			p.log("systeminfo_dc_gpo_detail", name, e.GetAttributeValue("cn"))
		}
	}
}

func resolveIPv4(hostname string) (string, error) {
	ips, err := net.LookupIP(hostname)
	if err != nil {
		return "", err
	}
	for _, ip := range ips {
		if ip.To4() != nil {
			return ip.String(), nil
		}
	}
	return "", fmt.Errorf("no IPv4 found")
}

View on GitHub (pinned to 95cc12e753)

Solutions

  1. Add an A (IPv4) record for the DC in DNS, or add a hosts-file entry mapping dcHost to its IPv4 address.
  2. Confirm the DC actually has an IPv4 interface and it's registered in DNS (ipconfig /all on the DC; check 'Register this connection's addresses in DNS').
  3. If the environment is IPv6-only, dial the DC directly by its IPv6 address instead of relying on the IPv4 fallback.
  4. Verify the resolver used by the scanning host returns the expected records (nslookup <dcHost>).

Example fix

// before (hosts entry / DNS has only ::1 style address)
//   ::1 dc01.corp.example.com
ipv4, err := resolveIPv4(dcHost) // "no IPv4 found"
// after
//   10.0.0.5 dc01.corp.example.com
ipv4, err := resolveIPv4(dcHost) // "10.0.0.5"
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check that the host resolves to at least one IPv4 address
ips, err := net.LookupHost(dcHost)
hasV4 := false
for _, ip := range ips {
    if net.ParseIP(ip).To4() != nil {
        hasV4 = true
    }
}
if !hasV4 {
    return fmt.Errorf("%s has no IPv4 record; add an A record", dcHost)

Prevention

When it happens

Trigger: net.LookupHost (or equivalent) for dcHost returns no addresses with ip.To4() != nil — e.g., the host only has AAAA records, or the lookup returned empty/loopback-only results.

Common situations: DC registered only with an IPv6 AAAA record, misconfigured DNS zone, hosts-file entry with an IPv6 address, or resolv setup returning IPv6-only results in a dual-stack environment where the LDAP path expects IPv4.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of shadow1ng/fscan@95cc12e753 (2026-09-06). Data as JSON: /api/errors/4b138769c38b4ea9. Report an issue: GitHub.