Bacon deploys your DNS records from YAML config files to Porkbun. You can use Bacon to deploy, back up, 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 jungaretti/bacon-deploy-action in your workflow.
See jungaretti/dns for an example of DNS records managed and deployed with jungaretti/bacon-deploy-action.
Download the latest release from GitHub.
- Install Bacon's prerequisites:
- Clone this repo and use
maketo 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 a .env file. Bacon uses these environment variables to authenticate with Porkbun. If the current directory contains a .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:
pingto double-check your API keys (stored in environment variables)deploy <config-file>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 config file by deleting, updating, and creating records. Defaults to a dry-run mode that doesn't modify your DNS records.
--dry-runpreview the deployment without making changes--confirmpreview and confirm the deployment (not compatible with--output json)--forceexecute the deployment without confirmation--output,-ooutput format:tableorjson(defaulttable)
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:
- host: example.com
type: ALIAS
ttl: 600
content: pixie.porkbun.com
- host: '*.example.com'
type: CNAME
ttl: 600
content: pixie.porkbun.com
- type: MX
host: example.com
content: in1-smtp.messagingengine.com
ttl: 600
priority: 10
notes: Email server
- type: MX
host: example.com
content: in2-smtp.messagingengine.com
ttl: 600
priority: 20
notes: Email server
- type: A
host: api.example.com
content: 42.42.42.42
ttl: 600
notes: API endpointtype- Required. Allowed values:A,MX,CNAME,ALIAS,TXT,AAAA,SRV,TLSA,CAA,HTTPS,SVCB.host- Required.content- Required.ttl- Required. Minimum value:600.priority- Optional. Allowed forMXandSRVrecords.notes- Optional. Private notes in Porkbun that are not exposed via DNS.
Bacon ignores
NSrecords and records whose host begins with_acme-challenge.
domain- Required.records- Optional. DNS records to deploy for the domain.
# Build Bacon
make build
# Run unit tests
make test-unit
# Run system tests (auth required)
make test-system