Bacon deploys your DNS records from YAML config files to Porkbun. You can use Bacon to deploy, backup, and restore your DNS records.
You can use Bacon locally or in a GitHub Actions workflow. For local use, download the latest release from GitHub or build it yourself. For GitHub Actions, use the Bacon Deploy Action in your workflow.
Download the latest release from GitHub.
- Install Bacon's prerequisites:
- Clone this repo and use
make
to buildbin/bacon
- Authenticate with your DNS provider (see below)
Sign into Porkbun and generate a new API keyset for your account. Read the "Generating API Keys" section of Porkbun's docs for more detailed instructions. Be sure to enable API access for the domain(s) that you would like to manage with Bacon.
Next, export
the PORKBUN_API_KEY
and PORKBUN_SECRET_KEY
environment variables or add them to an .env
file. Bacon uses these environment variables to authenticate with Porkbun. If the current directory contains an .env
file, then Bacon will load its contents into environment variables. See .env.example
for an example.
You can use bacon ping
to check your authentication configuration.
Bacon offers a few commands to help you deploy and save your DNS records:
ping
to double-check your API keys (stored in environment variables)deploy <config>
to deploy DNS records from a YAML config fileprint <domain>
to print your DNS records in YAML format
Verifies your API keys by pinging Porkbun.
Deploys records from a domain's config file by deleting unknown records and creating new records. Defaults to a dry-run mode that doesn't modify your DNS records.
--delete
disable dry-run deletions and delete outdated records--create
disable dry-run creations and create new records
Prints records for a domain in YAML format.
Use >
to redirect output to a Bacon config file. For example, bacon print example.com > example.com.yml
See config.example.yml
for a complete example.
domain: example.com
records:
- type: A
host: blog.example.com
content: 123.456.789.112
ttl: 600
- type: A
host: www.example.com
content: 123.456.789.112
ttl: 600
priority: 20
type
host
content
ttl
priority
domain
records
# Build Bacon
make build
# Run unit tests
make test-unit
# Run system tests (auth required)
make test-system