Bali, Indonesia
Insights

Moved Mail to a Fresh VPS IP and Spamhaus Blocks It Before You Send Anything

October 29, 2026
0:00
A fresh VPS feels like a clean slate. The IP was assigned yesterday, nothing has been sent from it, so it seems safe to assume its reputation starts at zero. Then mail cuts over, the first messages bounce with a Spamhaus reference in the rejection text, and the natural reaction is to suspect something on the new server is already spamming. Usually nothing is. The IP was listed before you ever touched it.
Providers don't create fresh IPv4 addresses for each order. The pool is finite, so addresses get reclaimed when a VPS is destroyed and handed to the next customer. The address you received may have belonged last month to someone running a compromised WordPress site, an open relay, or a bulk mailing operation. Blocklists track the address, not the account behind it, and a listing doesn't disappear the moment the previous tenant leaves. The second reason is less obvious. Some listings cover a range rather than a single address. When a blocklist operator sees abuse spread across many IPs in the same network, or decides a block of addresses isn't meant to send mail directly, it can list the whole block. Your IP inherits that listing even if no message has ever left it. So the clean-reputation assumption fails at the worst possible moment: cutover. By then MX records point to the new server, SPF has been updated, and mailboxes have moved. Rolling back takes time, and meanwhile outbound mail is bouncing or deferring. On the support desk this usually arrives as 'we just migrated and email broke.' The first thing worth reading is not the mail server config but the bounce message itself. Receiving servers that reject on Spamhaus typically say so, and often name the specific list.
Spamhaus publishes several lists with very different meanings, and a lot of time gets wasted treating any hit as 'blacklisted' without checking which one. The Policy Block List (PBL) is not an accusation. It marks address space that, according to the network owner or Spamhaus, shouldn't be delivering mail straight to the internet. Typically that means dynamic or end-user ranges, though hosting space can end up there too. A PBL hit says 'this IP isn't expected to run a mail server,' not 'this IP sent spam.' The Spamhaus Block List (SBL) is the serious one. It covers sources Spamhaus considers spam operations or services supporting them, and a listing can apply to one IP or to a whole range. Its CSS component targets snowshoe spam, where volume is spread thinly across many addresses to stay under detection thresholds. That pattern is exactly why recycled IPs in a provider's pool so often collide with existing listings. The Exploits Block List (XBL) lists IPs showing signs of compromise: infected machines, malware, abused proxies. On a recycled IP, an XBL entry is often leftover evidence of the previous tenant's compromised server. Most mail servers don't query these individually. They query ZEN, a combined zone covering SBL, XBL, and PBL in one lookup. The answer comes back as a code that tells you which list matched, so a single query tells you which situation you're in.
DNS blocklist lookups work by reversing the IP's octets and querying the result as a hostname under the list's zone. For the documentation address 203.0.113.45, that looks like this:
BASH
# Run on the new VPS or another server using its own recursive resolver
dig +short 45.113.0.203.zen.spamhaus.org A

# If an address comes back, fetch the reason text and listing reference
dig +short 45.113.0.203.zen.spamhaus.org TXT
An empty answer means the IP isn't in ZEN. Any answer in 127.0.0.0/8 is either a listing or an error, and the distinction matters:
Return codeMeaning
127.0.0.2SBL
127.0.0.3SBL CSS (snowshoe)
127.0.0.4 to 127.0.0.7XBL
127.0.0.9SBL DROP data
127.0.0.10 / 127.0.0.11PBL, maintained by the network owner / by Spamhaus
127.255.255.252 / .254 / .255Query error: malformed query, public resolver, or too many queries
Those error codes trip people up constantly. Spamhaus refuses queries arriving through large public DNS resolvers, so if your system resolver points at a public DNS service, you may get 127.255.255.254 back. That is not a listing. Depending on the resolver, you might also get an empty answer, which is not proof the IP is clean either. Run the check from a machine with its own recursive resolver, or use the IP reputation lookup on Spamhaus's own website as a cross-check. The web lookup also shows the listing record and the removal path, which saves a step. If the VPS has IPv6 enabled and the mail server might send over it, check that address too. A clean IPv4 doesn't help if outbound mail quietly leaves over IPv6. Spamhaus isn't the only list receivers use. It's worth running the same IP through a few other well-known blocklists before cutover, keeping in mind that some smaller lists carry far less weight than others.
This is where the list type really matters, because the person able to fix it differs. A Spamhaus-maintained PBL entry (127.0.0.11) can typically be removed through Spamhaus's self-service process if the IP genuinely runs a properly configured mail server. Set up reverse DNS first. A generic PTR like a provider-assigned hostname undercuts the claim that this is a real mail server, and receivers like Gmail will push back on it anyway. If reverse DNS is the part you're unsure about, this walkthrough on PTR records after migration covers it. A PBL entry maintained by the network owner (127.0.0.10) is controlled by your provider, not by you. An XBL entry can usually be self-removed once the cause is gone. On a freshly provisioned VPS the cause is typically gone already, since the previous machine no longer exists. One exception: if you restored a site from backup, make sure the backup isn't the compromised thing that got the IP listed in the first place. An SBL or CSS listing generally isn't something an individual customer can clear. The listing record usually names the network owner, and resolution goes through them. Range listings especially reflect Spamhaus's view of the provider's network, not of your server. The practical move is to open a ticket with your provider, include the lookup result, and ask for a different IP. That's far faster than waiting on a delisting you have no control over.
The production pattern is simple: treat the new IP as unverified until checked, and do the checking while the old server still handles mail.
  1. Provision the VPS and note both its IPv4 and IPv6 addresses.
  2. Check each address against ZEN from a proper resolver, and cross-check with the Spamhaus web lookup. If it's on SBL or CSS, request a replacement IP now, before any DNS changes.
  3. Set the PTR record to the mail hostname, and make sure that hostname's A record resolves back to the same IP.
  4. Configure the mail server's hostname and HELO name to match.
  5. Add the new IP to SPF while the old one is still listed, so both servers are authorized during the overlap.
  6. Send test messages from the new server to mailboxes you control at major providers and read the headers and any rejections.
  7. Only then switch MX and outbound routing, and keep the old server able to send until the new one has delivered cleanly for a while.
The point of this order is that every step happens while mail still works. Finding a listing at step two costs a support ticket. Finding it after step seven costs a day of bounced invoices. The short version: a new VPS IP has history you didn't create, so look it up before you trust it. Read which list matched before deciding what to do, because a PBL entry is a configuration question, an XBL entry is usually self-service, and an SBL entry is a conversation with your provider. Do all of it before cutover, and the migration stays boring.