Replacing an IP address
Sooner or later a server has to move to a different IP address. Your provider delivers a new block, you move to another data centre, or one address ends up on a blocklist and you want rid of it. That sounds like one action, but it is not: t
Written for: Administrator
Sooner or later a server has to move to a different IP address. Your provider delivers a new block, you move to another data centre, or one address ends up on a blocklist and you want rid of it. That sounds like one action, but it is not: the rest of the internet has your old address written down, and those copies do not all expire at the same moment.
So CoreCP does something most panels do not. There is a period in which your site answers on both addresses. Whoever already has the new address gets in, whoever still uses the old one gets in too, and only when almost nothing arrives on the old address any more do you let it go. No staying up at night, no "wait and hope".
Where — Panel → Hosting → Servers → the server → … menu → Replace an address. Screenshots are captured withopenwolf designqcand land in.wolf/designqc-captures/.
The short version
| Phase | What happens | How long |
|---|---|---|
| 1. Add the new address | The new address goes on the network card | seconds |
| 2. Lower the TTL | The DNS records go to 5 minutes | seconds, then waiting |
| 3. Repoint | DNS, SPF and outgoing mail point at the new address | seconds |
| 4. Phase out | Measure what still arrives on the old address | 72 hours (default) |
| 5. Release | The old address comes off the machine | seconds — and you press it |
Only step 5 is irreversible. Every other step can be undone with Abandon the replacement.
Step 1 — Start the replacement
Open the server, use the … menu and choose Replace an address. Pick the address that is going away and type the one taking its place. Nothing changes yet: you are only making the plan.
Under Phasing out are two values you can usually leave alone:
- Phase-out period — how long the old address stays up at a minimum. 72 hours by default.
- Threshold — once fewer than this share of requests still arrive on the old address, it may go. 1% by default.
Either one is enough. If the traffic is below the threshold after a day, you do not have to sit out the 72 hours.
On the command line:
# corectl ip migrate start 185.117.226.121 --to 185.117.226.123
[corecp] migration ipm-1786500000-a1b2c3 planned: 185.117.226.121 → 185.117.226.123 (v4, dedicated)
[corecp] phase-out period 72h, or until under 1.00% of requests still arrive on the old address
[corecp] next: corectl ip migrate preflight ipm-1786500000-a1b2c3Step 2 — Add the new address
Press Add the address. The server puts it on through netplan, with a rollback timer underneath: if anything goes wrong with the network configuration, the machine puts itself back within ninety seconds. You cannot make the server unreachable with this button.
You then see five checks. The important one is management address intact — it says the server is still reachable on the address you administer it on.
If reverse name (PTR) says there is none yet, that is not a problem for websites. For outgoing mail it is: ask the network's owner to set a PTR, then run corectl ip list --refresh.
Step 3 — Lower the TTL, and wait
Press Lower the TTL. Every DNS record that will move goes to 300 seconds.
Now comes the only real waiting. Under Safe to repoint after is a time. That is when the old TTL has expired everywhere: a resolver that fetched the record one second before your change holds the old answer for the old duration. Usually an hour.
You can repoint sooner with Repoint anyway, but then the overlap has to last that much longer. The screen says so too.
Step 4 — Repoint
Press Repoint the sites. This is the step it is all about, and four things happen at once:
- the A/AAAA records point at the new address;
- the SPF record names the new address, so your mail is not suddenly read as spam;
- outgoing mail leaves from the new address;
- the sites keep listening on the old address as well.
That last one is the whole point. Visitors still holding the old address in cache notice nothing.
Step 5 — Phase out, and measure
Under Phasing out you see how many requests still arrive on the old address. That is not an estimate: the web server writes down which local address accepted each connection, and those lines are counted.
Press Measure now to count again. You can also just leave the screen open; it catches up by itself.
While you wait, the list What only you can arrange sits at the bottom. That is the part outside CoreCP that you must not forget:
- reverse DNS (PTR) for the new address, at the network's owner;
- glue records if a nameserver name pointed at the old address — see Your own nameservers;
- licences keyed to an IP address (panels, WAFs, commercial mail filters);
- firewalls and allow-lists at third parties that name the old address.
Step 6 — Let the old address go
Once the phase-out period is over, or the traffic is below the threshold, the button at the bottom becomes live. It sits in a red frame and asks you to type the address out, because this is the only step you cannot undo: anyone still holding the old address in cache gets a refused connection until their resolver refreshes.
# corectl ip migrate release ipm-1786500000-a1b2c3
[corecp] 185.117.226.121 is off this node; 185.117.226.123 serves aloneIf you want to hold on to the address for a while — because you are handing it back to your provider next month rather than now — use --keep. The replacement is finished, and the address stays on the machine serving nothing.
The server's own management address
The address you administer the server on is not replaced in the panel. The agent, the server certificate and every site without an address of its own hang off it, so that happens on the machine itself:
$ ssh root@stck1.corecp.dev
# corectl ip migrate start 185.117.226.120 --to 185.117.226.130The panel does show the plan, so you know what you are about to do. Every phase is otherwise identical — rollback timer included.
Something went wrong?
I repointed too early. Press Abandon the replacement. The sites go back to the old address and both addresses stay on the machine. You can start again afterwards.
The old address will not come off. While the overlap stands, corectl ip remove refuses it and points at this wizard. That is deliberate: it is the only irreversible step, and it should have exactly one place.
The traffic says "not measured". The web server only started writing the local address down in this release. Run corectl reconcile on the server; the next measurement then counts for real. Until then the phase-out period is the only signal — and it keeps running.