Step 1 — Ask Replit to add publicIP to /api/health

Copy-paste this prompt to Replit:

Title: Add public outbound IP to /api/health (for OpenSRS allowlist)

Prompt: In server/index.ts, fetch the server’s public IP at startup and include it in /api/health:

// server/publicIp.ts
import fetch from "node-fetch";
let cachedPublicIP: string | null = null;
export async function getPublicIP() {
  if (cachedPublicIP) return cachedPublicIP;
  try {
    const r = await fetch("https://api.ipify.org?format=json", { timeout: 5000 });
    const j = await r.json();
    cachedPublicIP = j?.ip || null;
    return cachedPublicIP;
  } catch { return null; }
}

// server/index.ts
import { getPublicIP } from "./publicIp";
app.get("/api/health", async (_req, res) => {
  const publicIP = await getPublicIP();
  res.json({
    ok: true,
    env: process.env.NODE_ENV || "development",
    hostname: "localhost",
    corsOrigins: (process.env.CORS_ORIGINS || "").split(",").filter(Boolean),
    opensrsConfigured: !!process.env.OPENSRS_USER && !!process.env.OPENSRS_KEY,
    opensrsMode: process.env.OPENSRS_MODE || null,
    domainProvider: "opensrs",
    whmcsUrlHost: null,
    domainUrl: process.env.DOMAIN_URL || process.env.FRONTEND_URL || null,
    publicIP,
    time: new Date().toISOString(),
  });
});
console.log("[startup] public egress IP:", await getPublicIP());


Publish after adding this.

Step 2 — Grab the IP from Windows CMD

After Replit publishes, run:

curl -s https://ibrandbiz.com/api/health | findstr publicIP


You should see something like:

"publicIP":"X.X.X.X"

Step 3 — Whitelist that IP in OpenSRS (LIVE)

In the OpenSRS Reseller panel → Settings → API → Manage IP Addresses:

Add X.X.X.X/32 with Allow.

Save, wait ~1–2 minutes.

Step 4 — Test with a real domain (include a TLD)
curl -s "https://ibrandbiz.com/api/domain/price?name=albedetest123.com"


(or try in the UI)

If you still get a failure and the message says “invalid ip address,” it means the egress IP changed again (some PaaS do this). In that case, the durable fix is to route OpenSRS calls through a small proxy on a static-IP server you control (e.g., your Hetzner/WHMCS box) and whitelist that static IP in OpenSRS. I can give you a ready-to-run tiny proxy when you’re ready.