I think people fall into three categories when it comes to managing their DNS:
- Most people manage their DNS via a web browser: logging into their registrar, provider, panel, or third-party DNS provider and using their GUI to change DNS records.
- Those who have seven-figure manage their DNS through a series of baroque cloud API calls.
- And there are is a hardcore who manage their own DNS, thank you very much, and just jump into their zone files and probably use their own optimized system for managing serial numbers.
But what if you’re like me: a guy who can’t be bothered to run his own DNS server because he’s lazy, but when he finds himself in the command-line LowEndZone (ten terminal windows open, remnants of caffeinated beverages littering the desk, Willie Jones in the headphones), he hates to orthogonally break interface semantics and groan over to a web browser to update DNS hosted at his registrar?
In such a case, you might enjoy the Porkbun API. While the official examples use Python and Java, it’s just POSTing JSON and you can do that easily with curl as well.
Getting Started
To get started with the Porkbun API, you start by reading the article entitled Getting Started with the Porkbun API. Yes, it’s all going to be pretty much this straight-forward.
Follow instructions to do two things:
- Get your API keys.
- Turn on API access for the domain(s) you want to work with (it’s off by default).
Sample Use
Here’s a script that will create an A record called ‘example.lowend.party’, resolving 192.168.1.1.
#!/bin/bash curl --header "Content-Type: application/json" \ --request POST \ --data '{ "apikey" : "MY_API_KEY", "secretapikey" : "MY_SECRET_KEY", "name" : "example", "type" : "A", "content" : "1.2.3.4", "ttl" : "600" }' \ https://porkbun.com/api/json/v3/dns/create/lowend.party echo
When run, it returns:
# ./dns.sh {"status":"SUCCESS","id":302181389}
And to verify:
# nslookup example.lowend.party 8.8.8.8 Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: Name: example.lowend.party Address: 1.2.3.4 #
Full-Featured API
With the Porkbun API, you can do all the basic CRUD operations: create, retrieve, update, and delete. Retrieval includes by domain, so it’s possible to list all records for a domain.
Check the API docs for all the details, and then use the above curl script as a template because all you’ll be changing is the JSON you send and the API endpoint.
Related Posts:
NSD Tutorial Updated for 2024: Now With Zone Transfers!
Setup a Highly Available WordPress Site From Scratch, 2024 Edition! Part 7: Round-Robin DNS, Let’s ...
Setup a Highly Available WordPress Site From Scratch, 2024 Edition! Part 6: MariaDB Multi-Master
Setup a Highly Available WordPress Site From Scratch, 2024 Edition! Part 5: WordPress Install
Setup a Highly Available WordPress Site From Scratch, 2024 Edition! Part 4: Gluster
Setup a Highly Available WordPress Site From Scratch, 2024 Edition! Part 3: Ansible

Raindog308 is a longtime LowEndTalk community administrator, technical writer, and self-described techno polymath. With deep roots in the *nix world, he has a passion for systems both modern and vintage, ranging from Unix, Perl, Python, and Golang to shell scripting and mainframe-era operating systems like MVS. He’s equally comfortable with relational database systems, having spent years working with Oracle, PostgreSQL, and MySQL.
As an avid user of LowEndBox providers, Raindog runs an empire of LEBs, from tiny boxes for VPNs, to mid-sized instances for application hosting, and heavyweight servers for data storage and complex databases. He brings both technical rigor and real-world experience to every piece he writes.
Beyond the command line, Raindog is a lover of German Shepherds, high-quality knives, target shooting, theology, tabletop RPGs, and hiking in deep, quiet forests.
His goal with every article is to help users, from beginners to seasoned sysadmins, get more value, performance, and enjoyment out of their infrastructure.
You can find him daily in the forums at LowEndTalk under the handle @raindog308.
Many thanks. Just what I needed with a few little adjustments. Enjoy your day!