Skip to content

Commit

Permalink
DOCS: add dhcid RR docs (#2715)
Browse files Browse the repository at this point in the history
  • Loading branch information
fritterhoff authored Dec 11, 2023
1 parent 9e1cb0f commit a5a1fac
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
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

0 comments on commit a5a1fac

Please sign in to comment.