Porkbun domain to Vercel or Railway: DNS records step by step

Point a Porkbun domain at Vercel or Railway: delete the pixie.porkbun.com parking records, add an A or ALIAS on the root and a CNAME on www.

Simon, Founder of Shipyard

By · Founder of Shipyard

5 minute read

The short answer

To point a Porkbun domain at Vercel or Railway, first delete Porkbun's default parking records, the ones whose answer is pixie.porkbun.com. For Vercel, add an A record with a blank host and the IP from your project's Domains screen, plus a CNAME on www. For Railway, use Porkbun's "ALIAS - CNAME flattening" record on the blank host, a CNAME on www, and the TXT records Railway shows.

You can keep Porkbun as both registrar and DNS host for either platform. Moving the nameservers to Cloudflare is optional, and only worth it if you want Cloudflare's proxy, redirect rules or email routing in front of the app.

The records, side by side

Porkbun's DNS form has a Host field that you leave empty for the bare domain. Everything else follows from that one rule.

Host field at PorkbunVercelRailway
(blank) for the bare domainA record, IPv4 from Settings, DomainsALIAS - CNAME flattening, answer is Railway's target
wwwCNAME to your project's targetCNAME to the target Railway shows for www
VerificationTXT on _vercel, only if Vercel asksTXT record for each domain, name and value as shown
* wildcardDelete the parking CNAME unless you need itDelete the parking CNAME unless you need it
MX and SPF TXTLeave aloneLeave alone

Clear the parking records first

A new Porkbun domain is not empty. Porkbun adds default records whose value is pixie.porkbun.com, and they serve the parking page you see when you visit the name. If you try to add your host's CNAME or ALIAS while they are still there, Porkbun refuses with an error.

Porkbun's fix is simple: delete every record that points to pixie.porkbun.com, then add the host's records again. If there are no pixie records and the error still appears, an older record from a previous host occupies the same Host value. Delete that one instead.

Two things to leave in place. The MX records fwd1.porkbun.com and fwd2.porkbun.com and the SPF TXT record run Porkbun's email forwarding, so keep them if you use it. Also avoid the Park Domain option in the Details menu as a way to tidy up. Porkbun's guide says parking removes the ALIAS, CNAME, A and AAAA records for the root, www and the wildcard, which takes the app offline.

Text
Could not add DNS record: A CNAME or ALIAS record with that host already exists

Vercel: tallyfern.com on Porkbun DNS

Railway: kilnmark.com on Porkbun DNS

Railway gives each custom domain a CNAME target, such as abc123.up.railway.app, and a TXT record for ownership. Its docs are explicit that both are needed. Without the TXT record, requests to the custom domain return a 404 even after the CNAME resolves.

A CNAME is not allowed on a bare domain, so Railway asks for CNAME flattening or a dynamic ALIAS record there. Porkbun offers exactly that. Its guide for hosts that give a hostname instead of an IP uses an ALIAS record with a blank host for the root and a CNAME on www.

For kilnmark.com, add the bare name and www.kilnmark.com as custom domains in the Railway service. Then add these records at Porkbun:

Should you move the nameservers to Cloudflare?

Porkbun's DNS covers what Vercel and Railway need, so moving is a choice, not a requirement. Move if you want Cloudflare's proxy and firewall, its redirect rules, or Cloudflare Email Routing. Stay if you rely on Porkbun's email forwarding or URL forwarding, because Porkbun warns that changing nameservers usually breaks Porkbun-hosted services.

To move, add the domain to Cloudflare and check that its scan picked up every record, especially MX and TXT. Then at Porkbun open Details, click the edit icon by Nameservers, remove all existing entries, paste Cloudflare's two names one per line, click Save Nameservers and confirm with Submit. Porkbun says the change can take up to 48 hours, and most places see it within a few hours.

If you switched on the Porkbun DNSSEC toggle earlier, turn it off before the move. Cloudflare's docs ask you to disable DNSSEC at the registrar before changing nameservers, otherwise the domain fails to resolve.

Check it from outside

Ask a public resolver rather than your browser, which may still hold the parking page. The bare domain should return only your host's address, and nothing should mention pixie.porkbun.com.

Terminal
# who answers for the domain: Porkbun or Cloudflare?
dig NS kilnmark.com +short

# bare domain: Vercel's IP, or the flattened Railway address
dig @1.1.1.1 kilnmark.com A +short

# www: the host's CNAME target
dig @1.1.1.1 www.kilnmark.com CNAME +short

# Windows without dig
nslookup -type=cname www.kilnmark.com 1.1.1.1

If it still does not work

Doing it on launch

Shipyard runs DNS on Cloudflare, so with a Porkbun domain the one manual step is changing the nameservers at Porkbun. After that it adds the domain at Railway or Vercel and writes the records each host asks for. The provider notes list what it needs from each account.

Sources

Launch in an hour, not a weekend

Shipyard connects your accounts once, then sets up the domain, hosting, database, email and payments for every new product.

Get started See how it works

Read next