{"record":{"id":"89c903a9c195b51c","repo":"owasp-amass/amass","slug":"no-ptr-records-found-for-s","errorCode":null,"errorMessage":"no PTR records found for %s","messagePattern":"no PTR records found for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"engine/plugins/horizontals/ipaddr.go","lineNumber":61,"sourceCode":"\t\treturn nil\n\t}\n\n\th.process(e, ip, fqdn)\n\treturn nil\n}\n\nfunc (h *horaddr) lookupPTRRecordName(sess et.Session, ip *dbt.Entity) (*dbt.Entity, error) {\n\tsince, err := support.TTLStartTime(sess.Config(), string(oam.IPAddress), string(oam.FQDN), h.plugin.name)\n\tif err != nil || since.IsZero() {\n\t\treturn nil, errors.New(\"IPAddress -> FQDN transformation not supported\")\n\t}\n\n\tctx, cancel := context.WithTimeout(sess.Ctx(), 30*time.Second)\n\tdefer cancel()\n\n\tedges, err := sess.DB().OutgoingEdges(ctx, ip, since, \"ptr_record\")\n\tif err != nil || len(edges) == 0 {\n\t\treturn nil, fmt.Errorf(\"no PTR records found for %s\", ip.Asset.Key())\n\t}\n\n\tptr, err := sess.DB().FindEntityById(ctx, edges[0].ToEntity.ID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to acquire the entity with ID: %s\", edges[0].ToEntity.ID)\n\t}\n\n\treturn ptr, nil\n}\n\nfunc (h *horaddr) lookupPTRRecordData(sess et.Session, ptr *dbt.Entity) (*dbt.Entity, error) {\n\tsince, err := support.TTLStartTime(sess.Config(), string(oam.FQDN), string(oam.FQDN), h.plugin.name)\n\tif err != nil || since.IsZero() {\n\t\treturn nil, errors.New(\"FQDN -> FQDN transformation not supported\")\n\t}\n\n\tctx, cancel := context.WithTimeout(sess.Ctx(), 30*time.Second)\n\tdefer cancel()","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/horizontals/ipaddr.go#L43-L79","documentation":"lookupPTRRecordName queries the graph database for outgoing 'ptr_record' edges from the given IP entity. If the query errors or yields no edges, no reverse-DNS name is available for the IP, so it returns this error. It signals that the horizontal enumeration step cannot proceed for this asset.","triggerScenarios":"sess.DB().OutgoingEdges(ctx, ip, since, \"ptr_record\") returns err != nil, or returns zero edges because no PTR relationship was ever discovered/stored for this IP within the 'since' time window.","commonSituations":"IP has no reverse DNS configured at all (very common for cloud/provider IPs); data was released (since timestamp) so old edges are filtered out; DB query failure (locked/closed store); the IP entity was created by a source that does not perform PTR lookups.","solutions":["Verify the IP actually has a PTR record: dig -x <ip> or a reverse-DNS API.","Check the 'since' timestamp passed to OutgoingEdges — widening the window may reveal existing edges.","Ensure a data source that discovers PTR records has run and its data was committed to the graph.","Handle this error gracefully in check() and skip the IP rather than aborting the scan.","If OutgoingEdges returned err != nil, log the underlying DB error and investigate the graph store."],"exampleFix":"// before\nedges, err := sess.DB().OutgoingEdges(ctx, ip, since, \"ptr_record\")\nif err != nil || len(edges) == 0 {\n\treturn nil, fmt.Errorf(\"no PTR records found for %s\", ip.Asset.Key())\n}\n// after\nedges, err := sess.DB().OutgoingEdges(ctx, ip, since, \"ptr_record\")\nif err != nil {\n\treturn nil, fmt.Errorf(\"no PTR records found for %s: %w\", ip.Asset.Key(), err)\n}\nif len(edges) == 0 {\n\treturn nil, fmt.Errorf(\"no PTR records found for %s\", ip.Asset.Key()) // typed sentinel for graceful skip\n}","handlingStrategy":"try-catch","validationCode":"if strings.TrimSpace(ipStr) == \"\" || net.ParseIP(ipStr) == nil {\n\treturn fmt.Errorf(\"invalid IP, skip PTR lookup\")\n}","typeGuard":null,"tryCatchPattern":"ptr, err := lookupPTRRecordName(sess, ipEnt)\nif err != nil {\n\t// no PTR for this IP is common: log at debug and skip\n\treturn nil\n}","preventionTips":["Expect many public IPs to lack PTR records","Keep PTR-discovery data sources enabled before horizontals","Check the 'since' window does not exclude recent edges","Never fail the scan for a missing PTR record"],"tags":["go","database","dns","ptr"],"backgroundTag":"record-not-found","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}