Introducing a new way to review your PRs.

Read the announcement

techarohq / anubis

Weighs the soul of incoming HTTP requests to stop AI crawlers

View on GitHub

19 documents · Updated Nov 23, 2026

docs / dns-and-reputation-signals

DNS, reputation, and service signals

This subsystem turns a request address and related host data into signals for policy decisions. It combines cached DNS lookups, DNS blocklist results, address-prefix lists, proxy-aware client address handling, and honeypot history. These signals feed bot rules rather than acting as a complete identity proof.

Signal flow

The request enters through the proxy address boundary, which supplies the client address used by policy checks. Policy rules can then combine that address with DNS results, list membership, or honeypot history before the server allows, denies, weighs, or challenges the request.

flowchart LR
    R[Incoming request] --> A[Client address boundary]
    A --> P[Policy evaluation]
    P --> D[Cached DNS lookups]
    P --> B[DNS blocklist result]
    P --> I[Static or remote IP list]
    P --> H[Honeypot history]
    D --> S[Signals]
    B --> S
    I --> S
    H --> S
    S --> O[Allow, deny, weigh, or challenge]

DNS signals

The DNS service provides forward lookup, reverse lookup, and forward-confirmed reverse DNS (FCrDNS). It is shared by policy expressions, so repeated checks can use stored results instead of issuing a new network lookup for each request.

DNS lookup and cache

Forward lookup maps a host name to addresses. Reverse lookup maps an address to host names and removes the trailing dot from returned names. Both result types use separate cache entries with configurable time-to-live values; the default forward and reverse time-to-live is 300 seconds. A missing DNS record becomes an empty result, while other lookup errors remain errors at the DNS service boundary. References: internal/…/dns.go• L34-85, internal/…/cache.go• L12-31, internal/…/cache.go• L34-69, lib/…/config.go• L387-402, lib/…/config.go• L484-504

Forward-confirmed reverse DNS

FCrDNS checks whether an address has a reverse name and whether that name resolves back to the same address. A rule may also require the reverse name to match a pattern. This makes the signal stronger than a PTR record alone, but it still depends on current DNS data and should be combined with other request signals. References: internal/…/dns.go• L88-148, lib/…/environment.go• L61-148, docs/…/expressions.mdx• L294-380

DNS blocklist reputation

The DNS blocklist check queries DroneBL for the client address when the policy enables dnsbl. The result is cached for 24 hours and is treated as a reputation signal that can identify listed activity such as proxies, drones, or brute-force sources.

The check runs before normal rule handling. A clean result lets the request continue. A listed result returns the configured deny status. A lookup failure returns service-unavailable instead of silently treating the address as clean, so an operator can distinguish an unavailable reputation source from a good reputation. References: lib/anubis.go• L328-355, lib/anubis.go• L490-523, internal/…/dnsbl.go• L12-30, lib/…/config.go• L308-320

IP lists and service signals

IP lists express known address ranges as CIDR prefixes. A policy can use a local list in a rule, or it can refresh a published JSON prefix list and replace its in-memory match set after a successful update.

Local address lists

Local address lists match the client address against IPv4 or IPv6 ranges. The generated remote_addresses rule format lets an external blocklist become an allow, deny, or weight rule. This keeps list ownership outside request evaluation while keeping the policy action inside the normal rule system. References: lib/…/checker.go• L21-65, utils/…/main.go• L17-22, utils/…/main.go• L82-105, docs/…/policies.mdx• L99-116

Published address lists

Published lists use the Google/OpenAI-style JSON format with a creation time and IPv4 or IPv6 prefixes. The remote checker starts empty, refreshes on a schedule, and keeps the last good list when a later fetch or parse fails. A changed creation time causes the active prefix set to be rebuilt. These lists identify address ownership or a known bot network; they do not prove that every request from a range is genuine. References: internal/…/iplist.go• L1-45, lib/…/remote_addresses_url.go• L31-77, lib/…/remote_addresses_url.go• L89-113, lib/…/remote_addresses_url.go• L145-220

Blocklist service labels

DroneBL returns a service label for a listed address. Labels include proxy types, open resolvers, compromised routers, and attack sources. The label is useful for policy and metrics because it preserves why the address was listed instead of reducing every result to a single Boolean. References: internal/…/dnsbl.go• L12-30, internal/…/dnsbl.go• L68-100, internal/…/droneblresponse_string.go• L40-53

Reverse-proxy address handling

The request address boundary normalizes the client address into X-Real-IP, which is the address consumed by address rules, CEL expressions, DNSBL checks, and several honeypot paths. The boundary can use the socket address, a configured custom header, or the first available value from X-Forwarded-For.

The order matters. A present X-Real-IP is not replaced by X-Forwarded-For, while a configured remote-address mode can set it from the connection. Therefore the front proxy must write a trusted client address before policy evaluation. If the header is missing or is not an IP address, address-based checks report a configuration error rather than guessing. References: internal/headers.go• L50-110, lib/…/checker.go• L44-60, lib/…/celchecker.go• L65-91, lib/anubis.go• L337-353

Honeypot signals

The honeypot is a trap page that records visits and turns repeat behavior into a network signal. The active implementation stores request details such as time, user agent, and address, while it counts activity by a clamped network prefix.

For honeypot checks, the address is reduced to an IPv4 /24 or IPv6 /48. A network reaches the honeypot signal after 25 recorded visits. The signal can expose repeated crawler behavior without treating each address as a separate actor. The optional IP log records observed addresses for operational review. References: internal/…/honeypot.go• L10-23, internal/…/naive.go• L147-185, internal/…/naive.go• L218-279, internal/clampip.go• L5-32

Policy relationship

Policy construction creates one DNS service and its cache for the policy. Address rules and CEL expressions use that shared service, while the request path applies the DNSBL result before it proceeds to the configured rule action. GeoIP data supplies a separate enrichment path described in GeoIP enrichment and database updates; this page covers the DNS and reputation signals that can be combined with it from Network and identity intelligence.

References: lib/…/policy.go• L147-149 lib/…/policy.go• L161-215 lib/anubis.go• L337-359

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the X-Real-IP contract aligned across proxy middleware, address rules, CEL expressions, DNSBL checks, and honeypot handling.
  • Keep forward and reverse DNS cache keys, time-to-live settings, and policy defaults aligned when changing DNS lookup behavior.
  • Keep DroneBL response values and their string labels aligned when adding or changing reputation categories.
  • Keep published prefix-list parsing, refresh behavior, and rule matching aligned so a failed update cannot erase the last known-good list.
  • Keep the honeypot network-prefix size and visit threshold aligned with any change to stored network counts or address parsing.

Important failure modes

TriggerConsequenceGuard
The front proxy does not set X-Real-IPAddress rules and remote address lists report a policy misconfigurationSet the trusted client address before request evaluation
A DNSBL lookup failsThe request receives service-unavailable instead of a reputation decisionKeep the DNSBL source reachable and inspect the error log
A published prefix list fetch or parse failsThe last good list stays active; an initial list remains emptyValidate the feed format and monitor refresh warnings
A request reaches the honeypot without a valid addressThe honeypot cannot assign network history and returns an error responsePreserve a valid client address through the proxy chain

Key files

FileWhy to read it
internal/…/dns.goCore forward, reverse, and FCrDNS signal behavior
internal/…/cache.goShared DNS cache and time-to-live behavior
internal/…/dnsbl.goDNS blocklist query and service labels
lib/anubis.goRequest-time DNSBL gate and downstream policy flow
internal/headers.goReverse-proxy client address normalization
lib/…/checker.goLocal address-range matching and address contract
lib/…/remote_addresses_url.goPublished prefix-list refresh and replacement behavior
internal/…/naive.goHoneypot network history and request signals
internal/clampip.goNetwork prefix used for grouped honeypot activity