# Make https://erp.cnpsolutions.co.bw work (no hosts file)

## What the Hetzner server already does

Your app on **178.105.218.193** is configured to answer for hostname **`erp.cnpsolutions.co.bw`**.

That is **not** the same as the internet knowing that hostname = that IP.

| Layer | Who controls it | Your status |
|-------|-----------------|-------------|
| App + Caddy on VPS | You (Hetzner) | Done |
| **DNS** `erp` → `178.105.218.193` | Domain DNS (registrar / DNS host) | **Still wrong** (was 103.227.176.4) |

The **403 Forbidden** page is from the **old IP**, not from CNPERP.  
No server-side change on Hetzner can override global DNS without editing a **DNS record**.

This is **not** “using Zuri for hosting” — it is one line in DNS (like updating a phone book).

---

## The only fix for `https://erp.cnpsolutions.co.bw/` (no hosts file)

Create or update this record wherever **DNS for cnpsolutions.co.bw** is managed:

| Type | Name / host | Value | TTL |
|------|-------------|--------|-----|
| **A** | **erp** | **178.105.218.193** | 300 (or default) |

Full name: `erp.cnpsolutions.co.bw` → `178.105.218.193`

Wait 15 minutes–24 hours, then check:

```powershell
nslookup erp.cnpsolutions.co.bw
```

Must show **178.105.218.193** (not 103.227.176.4).

Then on the server:

```bash
ssh root@178.105.218.193
CNPERP_DOMAIN=erp.cnpsolutions.co.bw bash /opt/cnperp/deploy/hetzner/fix-caddy-tls.sh
```

Open: **https://erp.cnpsolutions.co.bw/**

---

## Where to edit DNS (pick one — no Zuri website required)

### A) Your domain registrar (Botswana .co.bw)

1. [WHOIS / NIC](https://whois.nic.net.bw/whois.jsp) — see who hosts DNS (nameservers).
2. Log in to **that** registrar’s DNS page (may be Zuri, Host267, or NIC partner).
3. Add only the **A** record above. Leave **MX** alone if email should keep working.

### B) Cloudflare (you control DNS; Zuri not involved in DNS edits)

1. Free account at [cloudflare.com](https://www.cloudflare.com).
2. Add site **cnpsolutions.co.bw**.
3. DNS → **A** record: name `erp`, IPv4 `178.105.218.193`, proxy **DNS only** (grey cloud).
4. Cloudflare shows two nameservers — set those **once** at your registrar (replaces `ns.mainnameserver.com` if you choose this path).
5. After propagation, run `fix-caddy-tls.sh` on the server.

### C) Until DNS propagates (optional, not the final URL)

**http://178.105.218.193/** serves the app on the server IP (HTTP only, no hostname).  
This does **not** replace fixing DNS for `https://erp.cnpsolutions.co.bw/`.

---

## What we do **not** use for ERP

- Zuri cPanel / old IP **103.227.176.4** for the website  
- `cnpsolutions.co.bw` apex (until you point it later)  
- Windows `hosts` file  

---

## Email to send (any DNS provider)

> Please set DNS for **cnpsolutions.co.bw**:  
> **A record** host **erp** → **178.105.218.193**  
> Do not change MX records.  
> We are not using 103.227.176.4 for the ERP site anymore.
