{"record":{"id":"4b138769c38b4ea9","repo":"shadow1ng/fscan","slug":"no-ipv4-found","errorCode":null,"errorMessage":"no IPv4 found","messagePattern":"no IPv4 found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/local/systeminfo_dc_windows.go","lineNumber":231,"sourceCode":"\tp.log(\"systeminfo_dc_gpos\", len(sr.Entries))\n\tfor _, e := range sr.Entries {\n\t\tif name := e.GetAttributeValue(\"displayName\"); name != \"\" {\n\t\t\tp.log(\"systeminfo_dc_gpo_detail\", name, e.GetAttributeValue(\"cn\"))\n\t\t}\n\t}\n}\n\nfunc resolveIPv4(hostname string) (string, error) {\n\tips, err := net.LookupIP(hostname)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tfor _, ip := range ips {\n\t\tif ip.To4() != nil {\n\t\t\treturn ip.String(), nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"no IPv4 found\")\n}\n","sourceCodeStart":213,"sourceCodeEnd":233,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/local/systeminfo_dc_windows.go#L213-L233","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add an A (IPv4) record for the DC in DNS, or add a hosts-file entry mapping dcHost to its IPv4 address.","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').","If the environment is IPv6-only, dial the DC directly by its IPv6 address instead of relying on the IPv4 fallback.","Verify the resolver used by the scanning host returns the expected records (nslookup <dcHost>)."],"exampleFix":"// before (hosts entry / DNS has only ::1 style address)\n//   ::1 dc01.corp.example.com\nipv4, err := resolveIPv4(dcHost) // \"no IPv4 found\"\n// after\n//   10.0.0.5 dc01.corp.example.com\nipv4, err := resolveIPv4(dcHost) // \"10.0.0.5\"","handlingStrategy":"validation","validationCode":"// Pre-check that the host resolves to at least one IPv4 address\nips, err := net.LookupHost(dcHost)\nhasV4 := false\nfor _, ip := range ips {\n    if net.ParseIP(ip).To4() != nil {\n        hasV4 = true\n    }\n}\nif !hasV4 {\n    return fmt.Errorf(\"%s has no IPv4 record; add an A record\", dcHost)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure every DC has an A record in DNS, not just AAAA.","Check hosts-file entries don't map DC names to IPv6-only addresses.","Verify with nslookup that the scanner's resolver returns A records for the DC."],"tags":["network","dns","ipv4","windows"],"backgroundTag":"resource-not-found","analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}