Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS: add dhcid RR docs #2715

Merged
merged 4 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions commands/types/dnscontrol.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,21 @@ declare function D(name: string, registrar: string, ...modifiers: DomainModifier
*/
declare function DEFAULTS(...modifiers: DomainModifier[]): void;

/**
* DHCID adds a DHCID record to the domain.
*
* Digest should be a string.
*
* ```javascript
* D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
* DHCID("example.com", "ABCDEFG")
* );
* ```
*
* @see https://docs.dnscontrol.org/language-reference/domain-modifiers/dhcid
*/
declare function DHCID(name: string, digest: string, ...modifiers: RecordModifier[]): DomainModifier;

/**
* `DISABLE_IGNORE_SAFETY_CHECK()` disables the safety check. Normally it is an
* error to insert records that match an `IGNORE()` pattern. This disables that
Expand Down
1 change: 1 addition & 0 deletions documentation/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* [CAA](functions/domain/CAA.md)
* [CAA_BUILDER](functions/domain/CAA_BUILDER.md)
* [CNAME](functions/domain/CNAME.md)
* [DHCID](functions/domain/DHCID.md)
* [DISABLE_IGNORE_SAFETY_CHECK](functions/domain/DISABLE_IGNORE_SAFETY_CHECK.md)
* [DMARC_BUILDER](functions/domain/DMARC_BUILDER.md)
* [DS](functions/domain/DS.md)
Expand Down
23 changes: 23 additions & 0 deletions documentation/functions/domain/DHCID.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: DHCID
parameters:
- name
- digest
- modifiers...
parameter_types:
name: string
digest: string
"modifiers...": RecordModifier[]
---

DHCID adds a DHCID record to the domain.

Digest should be a string.

{% code title="dnsconfig.js" %}
```javascript
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
DHCID("example.com", "ABCDEFG")
);
```
{% endcode %}
6 changes: 3 additions & 3 deletions integrationTest/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1539,10 +1539,10 @@ func makeTests(t *testing.T) []*TestGroup {
// ns("another-child", "ns101.cloudns.net."),
//),
),
testgroup("DHCPID",
testgroup("DHCID",
requires(providers.CanUseDHCID),
tc("Create DHCPID record", dhcid("test", "AAIBY2/AuCccgoJbsaxcQc9TUapptP69lOjxfNuVAA2kjEA=")),
tc("Modify DHCPID record", dhcid("test", "Test/AuCccgoJbsaxcQc9TUapptP69lOjxfNuVAA2kjEA=")),
tc("Create DHCID record", dhcid("test", "AAIBY2/AuCccgoJbsaxcQc9TUapptP69lOjxfNuVAA2kjEA=")),
tc("Modify DHCID record", dhcid("test", "Test/AuCccgoJbsaxcQc9TUapptP69lOjxfNuVAA2kjEA=")),
),

//// Vendor-specific record types
Expand Down
2 changes: 1 addition & 1 deletion models/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (dc *DomainConfig) Punycode() error {
rec.SetTarget(t)
case "CF_REDIRECT", "CF_TEMP_REDIRECT", "CF_WORKER_ROUTE":
rec.SetTarget(rec.GetTargetField())
case "A", "AAAA", "CAA", "DHCPID", "DS", "LOC", "NAPTR", "SOA", "SSHFP", "TXT", "TLSA", "AZURE_ALIAS":
case "A", "AAAA", "CAA", "DHCID", "DS", "LOC", "NAPTR", "SOA", "SSHFP", "TXT", "TLSA", "AZURE_ALIAS":
// Nothing to do.
default:
return fmt.Errorf("Punycode rtype %v unimplemented", rec.Type)
Expand Down