InfraNestInfraNest
Porkbun

Create a Porkbun API key

InfraNest talks to Porkbun with an API key and a secret API key. Creating them takes a minute — but there is a second step that catches almost everybody, so…

Updated November 12, 20263 min read

This article is for anyone connecting their Porkbun account to InfraNest and needs to create the access key Porkbun requires first.

#Overview

  • InfraNest connects to Porkbun using an API key and a Secret API key, which you generate from your Porkbun account.
  • Creating the key only takes a minute, but there's a second step — turning on API access for your domains — that almost everyone misses. Don't stop after step 5 below.

#Create the key

  1. Sign in to Porkbun.
  2. Go to Account → API Access (porkbun.com/account/api).
  3. Select Create API Key and give it a name you'll recognise, such as InfraNest.
  4. Porkbun shows you an API key starting pk1_ and a Secret API key starting sk1_.
  5. Copy both and paste them into InfraNest's Secret API key field when you connect Porkbun.

WarningThe secret key is shown once. If you lose it, create a new key pair rather than trying to recover it.

#Turn on API access for your domains

This is the step people miss. Creating a key does not, by itself, let it do anything to your domains. Porkbun controls API access per domain, and it is off by default.

The symptom is unmistakable once you know it: your domains all appear in InfraNest perfectly normally, and then every single change you try — nameservers, auto-renew, a DNS record — is refused. Nothing is wrong with your key.

You have two ways to fix it:

  1. All at once (recommended). On the same Account → API Access page, turn on Opt In All Domains. New domains you register later are then included automatically.
  2. One domain at a time. In your domain list at porkbun.com/account, open a domain and switch on its API Access toggle.
Create a Porkbun API key

InfraNest flags any domain that is still opted out so you can see which ones are left to turn on.

#Optional: restrict the key

Porkbun can lock a key down further. Both settings are optional and off unless you turn them on — find them behind the gear icon next to the key on the API Access page.

  • Source IP allowlist — only accept requests from certain addresses. Leave this empty: InfraNest doesn't connect from one fixed address, so with an allowlist every request can be refused no matter how correct your key is.
  • Target domain allowlist — only allow the key to touch certain domains. It is an exact match, so listing example.com does not cover any other domain you own.

If you are not sure, leave both empty. That is Porkbun's default and it works.

#Optional: spending controls

Porkbun spends from your prepaid account credit, and the same API Access page can limit how much a key may spend per month and email you when the balance drops below an amount you choose. InfraNest reads both and shows them on the connection, so a monthly limit you set here will not surprise you later.

NoteA monthly spend limit refuses charges even when your balance is healthy. If a renewal fails and the balance looks fine, check this setting.

#Troubleshooting

  • Every change is refused, but the key looks right: you've almost certainly missed the API access step above — check whether Opt In All Domains is on, or whether the individual domain's API Access toggle is on.
  • Requests are refused no matter what: check the Source IP allowlist on the key — if it has any addresses listed, remove them, since InfraNest doesn't use one fixed address.
  • A renewal fails even though your balance looks fine: check the monthly spend limit in your spending controls.

Related articles

Try this in your own account

Connect one provider and work through these steps against your own infrastructure.

Free plan · No credit card required · Set up in minutes