Skip to main content
A DNS Server (RFC 2136) connection lets an ACME certificate authority complete DNS-01 challenges on a DNS server you run, such as BIND, Knot DNS, PowerDNS, Infoblox, BlueCat, or Technitium. Infisical sends the server RFC 2136 dynamic updates that add a TXT record at _acme-challenge.<domain>, and removes the record after the certificate authority validates it. Each update is signed with a TSIG key, a shared secret that the DNS server uses to check that the update comes from a client it trusts.

Prerequisites

  • Admin access to the primary DNS server for the zone that holds your domains (secondary servers usually refuse updates)
  • A DNS server that accepts dynamic updates over TCP signed with a TSIG key
  • A Gateway that can reach the DNS server, if the server is on a private network
  • If you connect without a Gateway, a firewall rule that lets Infisical reach the DNS server over TCP on port 53 (or the port the server listens on)
Infisical Cloud can’t connect to private IP addresses without a Gateway. If you self-host Infisical, you can instead set ALLOW_INTERNAL_IP_CONNECTIONS to true on your instance.

Step 1: Create a TSIG key on your DNS server

Create a TSIG key, then allow the key to change TXT records at the _acme-challenge name of each domain you request certificates for. Limit the key to those records, so the key can’t change any other record in the zone. Use HMAC-SHA256 for the key if your server supports it. Infisical also accepts HMAC-SHA224, HMAC-SHA384, HMAC-SHA512, and HMAC-SHA1. Infisical doesn’t accept HMAC-MD5 or truncated algorithms such as hmac-sha256-128 in BIND, so if your server has one of those keys, create a new key.
1
Generate the key:
The file holds the key’s name, algorithm, and secret:
2
In named.conf, include the key file, and add an update-policy to the zone that lets the key change the TXT record at the challenge name:
Add a grant line for each domain, such as grant infisical-acme name _acme-challenge.www.example.com. TXT; for www.example.com. A subdomain grant, such as grant infisical-acme subdomain acme.example.com. TXT;, covers every name in a zone, so use one only for a zone that holds nothing but challenge records.BIND saves each update in a journal file next to the zone file, so named needs write access to the zone file’s directory.
BIND doesn’t accept allow-update and update-policy on the same zone. If the zone has allow-update { key dhcp-key; };, replace it with a grant in the same update-policy: grant dhcp-key zonesub ANY;. If allow-update lists IP addresses instead of keys, put the challenge records in a separate zone and point each _acme-challenge name at it with a CNAME.
3
Reload the configuration:
When you create the connection, enter infisical-acme as the Key Name, hmac-sha256 as the Algorithm, and the value between the quotes after secret as the Secret.
If your DNS server answers internal and external clients from different views (split-horizon DNS), updates signed with the key have to reach the view that answers the internet. Otherwise the certificate authority can’t find the TXT record. In BIND, start the match-clients list of each view above the external view with !key infisical-acme;, so BIND passes the updates to the external view.

Step 2: Create the app connection

Next, create the connection in Infisical with the key from Step 1.
1
In Certificate Manager, go to Settings > App Connections.App Connections Tab
2
Select Add Connection and choose DNS Server (RFC 2136).
3
Fill out the form’s fields:
  • Name: A name for the connection, such as bind-primary
  • Description (optional): A description of the connection
  • Host: The hostname or IP address of the zone’s primary DNS server, such as ns1.example.com, without a scheme or port
  • Port: The TCP port the DNS server listens on (usually 53)
  • Key Name: The name of the TSIG key, as configured on the DNS server
  • Algorithm: The algorithm of the TSIG key (hmac-sha256 is recommended)
  • Secret: The key’s base64 secret, exactly as it appears in the key file
  • Gateway (optional): The Gateway to connect through, if the DNS server is on a private network
Then, select Connect to DNS Server.
When you save the connection, Infisical sends a signed test query to the DNS server to check that it can reach the server and that the server accepts the key. Some servers, such as Knot DNS, don’t sign their answer to this query, so Infisical can only check that they’re reachable. On those servers, a wrong key shows up when the first certificate is requested. If the check fails, find the error message in Troubleshooting.
Your DNS Server (RFC 2136) connection is ready to use.

Step 3: Use the connection with an ACME certificate authority

When you register an ACME certificate authority, select DNS Server (RFC 2136) as the DNS Provider and your connection as the DNS App Connection. The Zone field is optional:
  • Enter the zone that holds your domains, such as example.com
  • Leave Zone empty, and Infisical looks up the zone for each challenge record on the DNS server
If a domain’s _acme-challenge name is a CNAME in public DNS, Infisical adds the TXT record at the CNAME’s target. The connection then has to point at the primary server for the target’s zone, and if you enter a zone, enter the target’s zone. After adding a challenge record, Infisical waits up to 60 seconds for each of the zone’s public nameservers to serve it before the certificate authority checks it. On Infisical Cloud, the order fails if a nameserver still doesn’t serve the record after 60 seconds.

Troubleshooting

If Infisical can’t save the connection or add a challenge record, the error message names the problem. Find the message in the following table: