owasp-amass/amass · warning
no PTR data found for %s
Error message
no PTR data found for %s
What it means
lookupPTRRecordData follows 'dns_record' edges from the PTR name entity to find the actual DNS answer data. If no such edges exist (or the query errors), the PTR name has no stored DNS data, and this error is returned. The plugin needs this data to extract the hostname pointed to by the reverse record.
Source
Thrown at engine/plugins/horizontals/ipaddr.go:83
if err != nil {
return nil, fmt.Errorf("failed to acquire the entity with ID: %s", edges[0].ToEntity.ID)
}
return ptr, nil
}
func (h *horaddr) lookupPTRRecordData(sess et.Session, ptr *dbt.Entity) (*dbt.Entity, error) {
since, err := support.TTLStartTime(sess.Config(), string(oam.FQDN), string(oam.FQDN), h.plugin.name)
if err != nil || since.IsZero() {
return nil, errors.New("FQDN -> FQDN transformation not supported")
}
ctx, cancel := context.WithTimeout(sess.Ctx(), 30*time.Second)
defer cancel()
edges, err := sess.DB().OutgoingEdges(ctx, ptr, since, "dns_record")
if err != nil || len(edges) == 0 {
return nil, fmt.Errorf("no PTR data found for %s", ptr.Asset.Key())
}
for _, edge := range edges {
if rel, ok := edge.Relation.(*oamdns.BasicDNSRelation); !ok || rel.Header.RRType != 12 {
continue
}
to, err := sess.DB().FindEntityById(ctx, edge.ToEntity.ID)
if err != nil {
continue
}
if _, valid := to.Asset.(*oamdns.FQDN); valid {
return to, nil
}
}
return nil, errors.New("failed to obtain the FQDN from the PTR data")View on GitHub (pinned to 79299dce87)
Solutions
- Ensure DNS resolution of the PTR name happens (e.g., the dns plugin resolves it) before this horizontal step.
- Widen the 'since' timestamp so existing dns_record edges are not filtered out.
- Check that stored relations keep the RRType 12 (PTR) relation — a relation-type change would skip all edges.
- Handle gracefully in check(): skip the PTR name when no data exists.
- Log the underlying OutgoingEdges error separately from the empty case.
Example fix
// before
edges, err := sess.DB().OutgoingEdges(ctx, ptr, since, "dns_record")
if err != nil || len(edges) == 0 {
return nil, fmt.Errorf("no PTR data found for %s", ptr.Asset.Key())
}
// after
edges, err := sess.DB().OutgoingEdges(ctx, ptr, since, "dns_record")
if err != nil {
return nil, fmt.Errorf("no PTR data found for %s: %w", ptr.Asset.Key(), err)
}
if len(edges) == 0 {
return nil, fmt.Errorf("no PTR data found for %s", ptr.Asset.Key())
} Defensive patterns
Strategy: try-catch
Try / catch
data, err := lookupPTRRecordData(sess, ptrEnt)
if err != nil {
// PTR name not resolved: skip this horizontal path
return nil
} Prevention
- Ensure DNS resolution runs before horizontals depend on dns_record edges
- Keep RRType 12 (PTR) relations intact when changing relation types
- Use a generous 'since' window for historical edges
- Skip gracefully when a PTR name is unresolvable
When it happens
Trigger: sess.DB().OutgoingEdges(ctx, ptr, since, "dns_record") returns err != nil or zero edges for the PTR FQDN entity within the 'since' window; or all edges exist but none carries a BasicDNSRelation with RRType 12 (PTR) so the loop finds no match.
Common situations: DNS resolution data was never collected for the PTR name by any plugin; data was released so old dns_record edges are filtered; resolution of the PTR name itself failed upstream; only non-PTR RRTypes were stored for the name.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- no PTR records found for %s
- failed to create the OAM Service asset
- failed to create the Organization asset
- failed to create the edge
- failed to acquire the entity with ID: %s
AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06).
Data as JSON: /api/errors/4fa40d25a1e4c0e4.
Report an issue: GitHub.