🔐 DNSSEC¶
DNSSEC (DNS Security Extensions) management operations and types.
🚀 Quick Examples¶
List DNSSEC Records¶
from oinker import AsyncPiglet
async with AsyncPiglet() as piglet:
records = await piglet.dnssec.list("example.com")
for record in records:
print(f"Key Tag: {record.key_tag}")
print(f"Algorithm: {record.algorithm}")
print(f"Digest Type: {record.digest_type}")
print(f"Digest: {record.digest[:32]}...")
Create DNSSEC Record¶
from oinker import AsyncPiglet, DNSSECRecordCreate
async with AsyncPiglet() as piglet:
await piglet.dnssec.create(
"example.com",
DNSSECRecordCreate(
key_tag="64087",
algorithm="13",
digest_type="2",
digest="15E445BD08128BDC213E25F1C8227DF4CB35186CAC701C1C335B2C406D5530DC",
)
)
Delete DNSSEC Record¶
async with AsyncPiglet() as piglet:
# Delete by key tag
await piglet.dnssec.delete("example.com", key_tag="64087")
Registry Behavior
Most registries will delete all DNSSEC records with matching data, not just the record with the matching key tag.
Operations¶
AsyncDNSSECAPI¶
oinker.dnssec.AsyncDNSSECAPI
¶
Async DNSSEC operations for the Porkbun API.
Accessed via piglet.dnssec.* methods.
Initialize DNSSEC API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
http
|
HttpClient
|
The HTTP client for making requests. |
required |
Source code in src/oinker/dnssec/_api.py
list
async
¶
Get DNSSEC records for a domain from the registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
domain
|
str
|
The domain name (e.g., "example.com"). |
required |
Returns:
| Type | Description |
|---|---|
list[DNSSECRecord]
|
List of DNSSEC records. |
Raises:
| Type | Description |
|---|---|
AuthenticationError
|
If credentials are invalid. |
NotFoundError
|
If domain is not found. |
APIError
|
If the request fails. |
Source code in src/oinker/dnssec/_api.py
create
async
¶
Create a DNSSEC record at the registry.
Note: DNSSEC creation differs at various registries. Most often only the DS data fields (key_tag, algorithm, digest_type, digest) are required.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
domain
|
str
|
The domain name. |
required |
record
|
DNSSECRecordCreate
|
The DNSSEC record to create. |
required |
Raises:
| Type | Description |
|---|---|
AuthenticationError
|
If credentials are invalid. |
NotFoundError
|
If domain is not found. |
APIError
|
If the request fails. |
Source code in src/oinker/dnssec/_api.py
delete
async
¶
Delete a DNSSEC record from the registry.
Note: Most registries will delete all records with matching data, not just the record with the matching key tag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
domain
|
str
|
The domain name. |
required |
key_tag
|
str
|
The key tag of the record to delete. |
required |
Raises:
| Type | Description |
|---|---|
AuthenticationError
|
If credentials are invalid. |
NotFoundError
|
If domain or record is not found. |
APIError
|
If the request fails. |
Source code in src/oinker/dnssec/_api.py
SyncDNSSECAPI¶
oinker.dnssec.SyncDNSSECAPI
¶
Types¶
DNSSECRecord¶
oinker.DNSSECRecord
dataclass
¶
A DNSSEC record from the registry.
Attributes:
| Name | Type | Description |
|---|---|---|
key_tag |
str
|
The DNSSEC key tag. |
algorithm |
str
|
The DS data algorithm. |
digest_type |
str
|
The digest type. |
digest |
str
|
The digest value. |
from_api_response
classmethod
¶
Create from API response data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key_tag
|
str
|
The key tag from the response dictionary key. |
required |
data
|
dict[str, Any]
|
The record data from API response. |
required |
Returns:
| Type | Description |
|---|---|
DNSSECRecord
|
A DNSSECRecord instance. |
Source code in src/oinker/dnssec/_types.py
DNSSECRecordCreate¶
oinker.DNSSECRecordCreate
dataclass
¶
DNSSECRecordCreate(
key_tag: str,
algorithm: str,
digest_type: str,
digest: str,
max_sig_life: str | None = None,
key_data_flags: str | None = None,
key_data_protocol: str | None = None,
key_data_algorithm: str | None = None,
key_data_public_key: str | None = None,
)
Parameters for creating a DNSSEC record.
Most registries only require the DS data fields (key_tag, algorithm, digest_type, digest). The key data fields are optional and vary by registry.
Attributes:
| Name | Type | Description |
|---|---|---|
key_tag |
str
|
The DNSSEC key tag. |
algorithm |
str
|
The DS data algorithm. |
digest_type |
str
|
The digest type. |
digest |
str
|
The digest value. |
max_sig_life |
str | None
|
Optional max signature life. |
key_data_flags |
str | None
|
Optional key data flags. |
key_data_protocol |
str | None
|
Optional key data protocol. |
key_data_algorithm |
str | None
|
Optional key data algorithm. |
key_data_public_key |
str | None
|
Optional key data public key. |