DNSBL Return Codes Explained: 127.0.0.2, 127.255.255.x and NXDOMAIN
A DNSBL lookup that returns an address in 127.0.0.0/8 means the IP or domain is listed; an NXDOMAIN answer means it is not. Beyond that, the exact number is list-specific, some 127.x answers are error codes rather than listings, and SERVFAIL or a timeout tells you nothing about listing status at all.
This guide walks through the conventions recorded in RFC 5782 and the return codes that Spamhaus, SpamCop and UCEPROTECT document on their own pages. It is based on those official pages as of November 2026. Lists change their data and policies, so check the operator's documentation before acting on a result. If you need the background on how blocklists work, start with what a DNSBL (RBL) is.
The basics: what RFC 5782 says about return codes
RFC 5782, published in February 2010, describes how DNS blacklists and whitelists are queried and what their answers look like. It is an Informational document, not a Standards Track specification: it records common practice, and the details of value assignments are left to each list operator.
How a lookup is built
For IPv4, you reverse the order of the octets and append the list's zone. To check 192.0.2.99 against bl.example.com:
dig +short 99.2.0.192.bl.example.com A
dig +short 99.2.0.192.bl.example.com TXTFor IPv6, the address is written as 32 hex nibbles in reverse order, followed by the zone. Domain-based lists simply take the domain name followed by the zone name; the RFC notes that name-based lists are far less common than IP-based ones.
The A record: listed or not
- Listed: the list returns an A record. The RFC says all A values should be in 127.0.0.0/8, to prevent unwanted network traffic, and that the value conventionally is 127.0.0.2.
- Not listed: there must not be any records for the address. In DNS terms, the answer is NXDOMAIN, meaning the name does not exist.
- The A record value must not be used as an IP address. 127.0.0.2 is a flag, not a server to connect to.
The TXT record: the reason and a URL
According to the RFC, DNSBLs should publish a TXT record describing why an entry is listed, and that reason often includes a URL with more information. Client software must check the A record and may check the TXT record. The TXT text is often used in the SMTP error message, so a bounce message may contain a lookup or removal URL taken from it.
Why lists return different numbers: sublists and bit masks
A value other than 127.0.0.2 usually means the zone combines several sublists. RFC 5782 describes three ways to represent them: subdomains, multiple A records, and bit-encoded values.
- Multiple A records: each sublist has its own value, and the list returns one A record for every sublist the address appears on.
- Bit masks: each sublist is assigned a bit, and the answer is the logical OR of the bits for every sublist that matches. In the RFC's example, an address on the 127.0.0.2 and 127.0.0.4 sublists returns 127.0.0.6.
The key point is that the RFC itself states there is no widely used convention for mapping sublist names to values. The same number can mean different things on different lists. Always read a return code together with the zone that produced it, against that list's own documentation. The RFC also says client software should be able to apply bit masks and value range tests to returned values.
Spamhaus ZEN is a good example of the multiple-answer style. Its documentation says a query generally produces several distinct answers in the same DNS response, one for each dataset on which the IP is listed, with a different return code for each dataset. Seeing two or three codes at once is normal.
Return codes for major blocklists
The table below covers return codes that the operators document on their official pages.
| List (zone) | Return code | Meaning (per the operator) |
|---|---|---|
| Spamhaus ZEN (zen.spamhaus.org) | 127.0.0.2 | SBL |
| Spamhaus ZEN | 127.0.0.3 | CSS |
| Spamhaus ZEN | 127.0.0.4 | XBL (CBL data) |
| Spamhaus ZEN | 127.0.0.9 | DROP, returned together with 127.0.0.2 |
| Spamhaus ZEN | 127.0.0.10 / 127.0.0.11 | PBL (ISP maintained / Spamhaus maintained) |
| Spamhaus DBL (dbl.spamhaus.org) | 127.0.1.2, 127.0.1.4 to 127.0.1.6 | Low-reputation domain: spam, phishing, malware, botnet C&C |
| Spamhaus DBL | 127.0.1.102 to 127.0.1.106 | Legitimate domain being abused (127.0.1.103: abused redirector domain used in spam) |
| Spamhaus DBL | 127.0.1.255 | An IP address was queried against the DBL, which is not allowed |
| SpamCop (bl.spamcop.net) | 127.0.0.2 | Listed |
| UCEPROTECT (dnsbl-1, dnsbl-2, dnsbl-3.uceprotect.net) | Not stated on the DNS usage page | One zone each for Level 1, 2 and 3 |
- Spamhaus: ZEN combines the SBL, CSS, XBL and PBL and covers IP addresses only; domains are checked against the DBL. The DBL uses 127.0.1.0/24 and the Zero Reputation Domains list uses 127.0.2.0/24. Because the DBL always answers an IP query with 127.0.1.255, it cannot be used to check IPs. For what each Spamhaus list means and how to request removal, see our Spamhaus removal guide.
- SpamCop: the official FAQ gives 127.0.0.2 as the response that indicates a listed IP. It also recommends giving users access to filtered mail, for example by tagging it or moving it to a separate folder, rather than rejecting it outright. Removal is covered in our SpamCop delisting guide.
- UCEPROTECT: the DNS usage page lists the three zone names but does not describe return values. It says the DNS method is really only useful for small to medium mail servers and suggests rsync for systems making more than 100,000 requests per day. The levels are explained in our UCEPROTECT Level 2 and 3 guide.
- Barracuda: its return values are not covered here. Check Barracuda Central's own pages.
127.255.255.x and public resolvers: answers that are not listings
Spamhaus reserves 127.255.255.0/24 for error codes. They can be returned for any zone, and the official FAQ states that they must not be taken to mean the queried object is listed.
| Return code | Meaning |
|---|---|
| 127.255.255.252 | Typing error in the DNSBL name |
| 127.255.255.254 | Query via a public or open resolver |
| 127.255.255.255 | Excessive number of queries |
Why public resolver results are unreliable
Spamhaus's FAQ says that when you query through large public resolvers, in most cases you get a not-listed (NXDOMAIN) reply. In other words, a listed IP can look clean. The same FAQ names using Amazon, Quad9, Google, Cloudflare or another public resolver as the most common cause of the opposite problem, where a list appears to block the whole internet.
Some resolvers also rewrite NXDOMAIN answers and return an IP address for names that do not exist. A mail server can mistake that for a listing. The FAQ suggests instructing the mail server to ignore any response that is not in 127.0.0.0/8, running your own resolver, or contacting your ISP or DNS provider. To see which resolver you are actually using, the FAQ gives this check:
dig txt whoami.fastly.netIf you run DNSBL filtering on your own mail server, also make sure it does not reject mail whenever it sees a 127.255.255.x answer. Spamhaus describes that as a misconfiguration.
NXDOMAIN vs SERVFAIL vs timeout
Every DNS response carries a response code (RCODE), defined in RFC 1035. When you read a DNSBL result, separate the RCODE from the A record value.
| Response | What it means in DNS | How to read it for a DNSBL |
|---|---|---|
| A record in 127.0.0.0/8 (except 127.255.255.x) | No error (NOERROR) | Listed; check the value against that list's documentation |
| NXDOMAIN (Name Error) | The queried name does not exist | Not listed, provided the query went through a suitable resolver |
| 127.255.255.x | A normal-looking answer that signals an error | Unknown; fix the resolver or the query |
| SERVFAIL (Server failure) | The name server could not process the query | Unknown |
| Timeout | No answer arrived | Unknown |
RFC 5782 does not say how clients should handle a list that fails or does not respond. Reading SERVFAIL or a timeout as either listed or not listed is a mistake. Retry later or query from a different path.
Use the test entries to check that a list works
RFC 5782 requires IPv4 lists to contain an entry for 127.0.0.2 and not to contain one for 127.0.0.1. IPv6 lists use ::FFFF:7F00:2 (listed) and ::FFFF:7F00:1 (not listed), and domain lists use the reserved name TEST (listed) and INVALID (not listed).
dig +short 2.0.0.127.zen.spamhaus.org A
dig +short 1.0.0.127.zen.spamhaus.org AIf the first query returns a listing code (a 127.x value other than 127.255.255.x) and the second returns nothing, lookups against that list are working. If the first returns 127.255.255.x, your query path is being refused. The RFC says clients should periodically check test entries and should not use a list without correct ones. It also notes that operators shutting down a list have sometimes removed every entry, or installed a wildcard that lists every address. If 127.0.0.1 also comes back as listed, suspect the list or your query path, not your own IP.
A practical way to read your own result
- Pick the right IP or domain. Use the IP in the bounce message, or the sending server's IP from the Received lines in the message headers.
- Check several lists at once. Our blacklist checker runs the major lists in one pass.
- Read each code together with its zone. A listing code in 127.0.0.0/8 (other than 127.255.255.x) means listed; look up what that value means on that list. A 127.255.255.x answer, SERVFAIL or a timeout means the status is still unknown.
- Look at the TXT record and the operator's lookup page. Many lists return a reason or URL. Treat the operator's own lookup page as the authoritative result.
- Fix the cause, then follow that list's removal process. Each operator decides whether and when to delist. If the cause remains, the listing usually comes back.
For the full troubleshooting path when mail is bouncing, see email blocked by a blacklist. If you need help interpreting results or tracking down the cause, you can ask us about delisting.
We introduce providers who take on delisting requests, consulting and advice (from JPY 50,000). Delisting is decided by each list operator and cannot be promised.
Get helpThis site may receive a referral fee from listed providers. About
FAQ
A lookup returned 127.0.0.2. Which list am I on?
You are on the list for the zone you queried. 127.0.0.2 is the conventional value many lists use, so the number alone does not identify the list. On Spamhaus ZEN it means SBL; on SpamCop it simply means listed. Read it with the zone name and that list's documentation.
I got 127.255.255.254. Am I blacklisted?
No. On Spamhaus zones this is an error code meaning the query came through a public or open resolver. It does not mean the IP is listed. Check again on Spamhaus's own lookup page, or query without going through a public resolver.
Why do different tools disagree about whether I am listed?
A common reason is the resolver used for the lookup. Through public resolvers, a listed IP can appear clean, or you can get error codes. A tool may also display SERVFAIL or a timeout as not listed. When in doubt, use the list operator's official lookup page.
There is no TXT record for my listing. Is something wrong?
Not necessarily. RFC 5782 says DNSBLs should publish a TXT reason, but it is not a must, and checking the TXT record is optional for clients. The A record is what determines a listing.
Official pages used
The facts in this article were checked against the official pages below at the time of publication. Policies and behavior change without notice, so check the official pages before relying on anything important.
- RFC 5782: DNS Blacklists and Whitelists
- RFC 1035: Domain Names - Implementation and Specification (RCODE)
- Spamhaus FAQ: DNSBL Usage (return codes and public resolvers)
- Spamhaus: ZEN Blocklist
- Spamhaus: Domain Blocklist (DBL)
- SpamCop FAQ: How do I configure my mailserver to reject mail based on the blocklist?
- UCEPROTECT: Using DNS Lookups
Related guides
What is a DNSBL? How DNS blacklists and RBLs work: reversed IP lookups, A and TXT records, IPv6, IP vs domain lists, whitelists, and why IPs get listed.
Listed on Spamhaus? Find out which list you are on (ZEN, PBL, XBL, CSS, SBL, DBL), what the return codes mean, and the right delisting path for each.
How to monitor your sending IPs and domains against DNS blacklists: a dig and cron script, a batch API with webhooks, and alerts that avoid false alarms.