1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

DOCS: consistency in code examples in language reference (#2394)

This commit is contained in:
Jeffrey Cafferata
2023-05-24 22:09:22 +02:00
committed by GitHub
parent 0b7dabacc8
commit e97cf01744
59 changed files with 691 additions and 548 deletions

View File

@ -88,10 +88,10 @@ and Gandi, or systems such as BIND.
```js ```js
// define our registrar and providers // define our registrar and providers
var namecom = NewRegistrar("name.com"); var REG_NAMECOM = NewRegistrar("name.com");
var r53 = NewDnsProvider("r53") var r53 = NewDnsProvider("r53")
D("example.com", namecom, DnsProvider(r53), D("example.com", REG_NAMECOM, DnsProvider(r53),
A("@", "1.2.3.4"), A("@", "1.2.3.4"),
CNAME("www","@"), CNAME("www","@"),
MX("@",5,"mail.myserver.com."), MX("@",5,"mail.myserver.com."),

File diff suppressed because it is too large Load Diff

View File

@ -15,17 +15,17 @@ For convenience, both configuration files are shown below.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var PROVIDER_NONE = NewRegistrar('none'); var PROVIDER_NONE = NewRegistrar("none");
var PROVIDER_TRANSIP = NewDnsProvider('transip', '-'); var PROVIDER_TRANSIP = NewDnsProvider("transip", "-");
D('cafferata.dev', D("cafferata.dev",
PROVIDER_NONE, PROVIDER_NONE,
DnsProvider(PROVIDER_TRANSIP), DnsProvider(PROVIDER_TRANSIP),
DefaultTTL('1d'), DefaultTTL("1d"),
TXT('spf', [ TXT("spf", [
'v=spf1', "v=spf1",
'-all' "-all"
].join(' ')) ].join(" "))
); );
``` ```
{% endcode %} {% endcode %}
@ -99,18 +99,18 @@ Because the above GitLab CI configuration expects a diff, we apply this by (_for
`dnsconfig.js` `dnsconfig.js`
```diff ```diff
var PROVIDER_NONE = NewRegistrar('none'); var PROVIDER_NONE = NewRegistrar("none");
var PROVIDER_TRANSIP = NewDnsProvider('transip', '-'); var PROVIDER_TRANSIP = NewDnsProvider("transip", "-");
D('cafferata.dev', D("cafferata.dev",
PROVIDER_NONE, PROVIDER_NONE,
DnsProvider(PROVIDER_TRANSIP), DnsProvider(PROVIDER_TRANSIP),
DefaultTTL('1d'), DefaultTTL("1d"),
TXT('spf', [ TXT("spf", [
'v=spf1', "v=spf1",
+ 'include:_spf.google.com', + "include:_spf.google.com",
'-all' "-all"
].join(' ')) ].join(" "))
); );
``` ```

View File

@ -39,14 +39,14 @@ var GOOGLE_APPS_DOMAIN_SITES = [
CNAME("start", "ghs.googlehosted.com."), CNAME("start", "ghs.googlehosted.com."),
]; ];
D("primarydomain.tld", REG_NAMECOM, DnsProvider(...), D("primarydomain.tld", REG_NAMECOM, DnsProvider(DSP_MY_PROVIDER),
GOOGLE_APPS_DOMAIN_MX, GOOGLE_APPS_DOMAIN_MX,
GOOGLE_APPS_DOMAIN_SITES, GOOGLE_APPS_DOMAIN_SITES,
A(...), A(...),
CNAME(...) CNAME(...)
} }
D("aliasdomain.tld", REG_NAMECOM, DnsProvider(...), D("aliasdomain.tld", REG_NAMECOM, DnsProvider(DSP_MY_PROVIDER),
GOOGLE_APPS_DOMAIN_MX, GOOGLE_APPS_DOMAIN_MX,
// FYI: GOOGLE_APPS_DOMAIN_SITES is not used here. // FYI: GOOGLE_APPS_DOMAIN_SITES is not used here.
A(...), A(...),
@ -65,7 +65,7 @@ Solution 1: Use a macro.
``` ```
function PARKED_R53(name) { function PARKED_R53(name) {
D(name, REG_NAMECOM, DnsProvider(...), D(name, REG_NAMECOM, DnsProvider(DSP_MY_PROVIDER),
A("@", "10.2.3.4"), A("@", "10.2.3.4"),
CNAME("www", "@"), CNAME("www", "@"),
SPF_NONE, //deters spammers from using the domain in From: lines. SPF_NONE, //deters spammers from using the domain in From: lines.
@ -89,7 +89,7 @@ _.each(
"example3.tld", "example3.tld",
], ],
function (d) { function (d) {
D(d, REG_NAMECOM, DnsProvider(...), D(d, REG_NAMECOM, DnsProvider(DSP_MY_PROVIDER),
A("@", "10.2.3.4"), A("@", "10.2.3.4"),
CNAME("www", "@"), CNAME("www", "@"),
END); END);

View File

@ -2,7 +2,7 @@
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REG, DnsProvider(...), D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
A("@", "1.2.3.4"), // The naked or "apex" domain. A("@", "1.2.3.4"), // The naked or "apex" domain.
A("server1", "2.3.4.5"), A("server1", "2.3.4.5"),
AAAA("wide", "2001:0db8:85a3:0000:0000:8a2e:0370:7334"), AAAA("wide", "2001:0db8:85a3:0000:0000:8a2e:0370:7334"),
@ -43,7 +43,7 @@ var addrA = IP("1.2.3.4")
var DSP_R53 = NewDnsProvider("route53_user1"); var DSP_R53 = NewDnsProvider("route53_user1");
D("example.com", REG, DnsProvider(DSP_R53), D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_R53),
A("@", addrA), // 1.2.3.4 A("@", addrA), // 1.2.3.4
A("www", addrA + 1), // 1.2.3.5 A("www", addrA + 1), // 1.2.3.5
) )
@ -70,7 +70,7 @@ var dcB = IP("6.6.6.6");
// switch to dcB to failover // switch to dcB to failover
var activeDC = dcA; var activeDC = dcA;
D("example.com", REG, DnsProvider(DSP_R53), D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_R53),
A("@", activeDC + 5), // fixed address based on activeDC A("@", activeDC + 5), // fixed address based on activeDC
) )
``` ```
@ -96,7 +96,7 @@ var GOOGLE_APPS_CNAME_RECORDS = [
CNAME("start", "ghs.googlehosted.com."), CNAME("start", "ghs.googlehosted.com."),
] ]
D("example.com", REG, DnsProvider(DSP_R53), D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_R53),
GOOGLE_APPS_MX_RECORDS, GOOGLE_APPS_MX_RECORDS,
GOOGLE_APPS_CNAME_RECORDS, GOOGLE_APPS_CNAME_RECORDS,
A("@", "1.2.3.4") A("@", "1.2.3.4")
@ -107,7 +107,7 @@ D("example.com", REG, DnsProvider(DSP_R53),
## Use SPF_BUILDER to add comments to SPF records ## ## Use SPF_BUILDER to add comments to SPF records ##
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.tld", REG, DSP, ... D("example.tld", REG_MY_PROVIDER, DSP, ...
A("@", "10.2.2.2"), A("@", "10.2.2.2"),
MX("@", "example.tld."), MX("@", "example.tld."),
SPF_BUILDER({ SPF_BUILDER({
@ -147,19 +147,19 @@ DEFAULTS(
var DSP_R53 = NewDnsProvider("route53_user1"); var DSP_R53 = NewDnsProvider("route53_user1");
var DSP_GCLOUD = NewDnsProvider("gcloud_admin"); var DSP_GCLOUD = NewDnsProvider("gcloud_admin");
D("example.com", REG, DnsProvider(DSP_R53), DnsProvider(DSP_GCLOUD), D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_R53), DnsProvider(DSP_GCLOUD),
A("@", "1.2.3.4") A("@", "1.2.3.4")
) )
// above zone uses 8 NS records total (4 from each provider dynamically gathered) // above zone uses 8 NS records total (4 from each provider dynamically gathered)
// below zone will only take 2 from each for a total of 4. May be better for performance reasons. // below zone will only take 2 from each for a total of 4. May be better for performance reasons.
D("example2.com", REG, DnsProvider(DSP_R53, 2), DnsProvider(DSP_GCLOUD ,2), D("example2.com", REG_MY_PROVIDER, DnsProvider(DSP_R53, 2), DnsProvider(DSP_GCLOUD ,2),
A("@", "1.2.3.4") A("@", "1.2.3.4")
) )
// or set a Provider as a non-authoritative backup (don"t register its nameservers) // or set a Provider as a non-authoritative backup (don"t register its nameservers)
D("example3.com", REG, DnsProvider(DSP_R53), DnsProvider(DSP_GCLOUD, 0), D("example3.com", REG_MY_PROVIDER, DnsProvider(DSP_R53), DnsProvider(DSP_GCLOUD, 0),
A("@", "1.2.3.4") A("@", "1.2.3.4")
) )
``` ```

View File

@ -18,7 +18,7 @@ Modifiers can be any number of [record modifiers](https://docs.dnscontrol.org/la
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, DnsProvider("R53"), D("example.com", REG_MY_PROVIDER, DnsProvider("R53"),
A("@", "1.2.3.4"), A("@", "1.2.3.4"),
A("foo", "2.3.4.5"), A("foo", "2.3.4.5"),
A("test.foo", IP("1.2.3.4"), TTL(5000)), A("test.foo", IP("1.2.3.4"), TTL(5000)),

View File

@ -20,7 +20,7 @@ Modifiers can be any number of [record modifiers](https://docs.dnscontrol.org/la
```javascript ```javascript
var addrV6 = "2001:0db8:85a3:0000:0000:8a2e:0370:7334" var addrV6 = "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
D("example.com", REGISTRAR, DnsProvider("R53"), D("example.com", REG_MY_PROVIDER, DnsProvider("R53"),
AAAA("@", addrV6), AAAA("@", addrV6),
AAAA("foo", addrV6), AAAA("foo", addrV6),
AAAA("test.foo", addrV6, TTL(5000)), AAAA("test.foo", addrV6, TTL(5000)),

View File

@ -20,7 +20,7 @@ Target should be a string representing the target. If it is a single label we wi
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, DnsProvider("CLOUDFLARE"), D("example.com", REG_MY_PROVIDER, DnsProvider("CLOUDFLARE"),
ALIAS("@", "google.com."), // example.com -> google.com ALIAS("@", "google.com."), // example.com -> google.com
); );
``` ```

View File

@ -21,12 +21,12 @@ correct syntax is `AUTODNSSEC_ON` not `AUTODNSSEC_ON()`
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", .... , D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
AUTODNSSEC_ON, // Enable AutoDNSSEC. AUTODNSSEC_ON, // Enable AutoDNSSEC.
A("@", "10.1.1.1") A("@", "10.1.1.1")
); );
D("insecure.com", .... , D("insecure.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
AUTODNSSEC_OFF, // Disable AutoDNSSEC. AUTODNSSEC_OFF, // Disable AutoDNSSEC.
A("@", "10.2.2.2") A("@", "10.2.2.2")
); );

View File

@ -50,7 +50,7 @@ This arrangement is useful if you want some record sets to be aliases and some n
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, DnsProvider("AZURE_DNS"), D("example.com", REG_MY_PROVIDER, DnsProvider("AZURE_DNS"),
AZURE_ALIAS("foo", "A", "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"), // record for traffic manager AZURE_ALIAS("foo", "A", "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/trafficManagerProfiles/testpp2"), // record for traffic manager
AZURE_ALIAS("foo", "CNAME", "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/dnszones/example.com/A/quux."), // record in the same zone AZURE_ALIAS("foo", "CNAME", "/subscriptions/726f8cd6-6459-4db4-8e6d-2cd2716904e2/resourceGroups/test/providers/Microsoft.Network/dnszones/example.com/A/quux."), // record in the same zone
); );

View File

@ -26,7 +26,7 @@ Flags are controlled by modifier:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, DnsProvider("GCLOUD"), D("example.com", REG_MY_PROVIDER, DnsProvider("GCLOUD"),
// Allow letsencrypt to issue certificate for this domain // Allow letsencrypt to issue certificate for this domain
CAA("@", "issue", "letsencrypt.org"), CAA("@", "issue", "letsencrypt.org"),
// Allow no CA to issue wildcard certificate for this domain // Allow no CA to issue wildcard certificate for this domain

View File

@ -35,7 +35,7 @@ This example redirects the bare (aka apex, or naked) domain to www:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("foo.com", .... , D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
CF_REDIRECT("mydomain.com/*", "https://www.mydomain.com/$1"), CF_REDIRECT("mydomain.com/*", "https://www.mydomain.com/$1"),
); );
``` ```

View File

@ -28,7 +28,7 @@ managed by DNSControl and those that aren't.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("foo.com", .... , D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
CF_TEMP_REDIRECT("example.mydomain.com/*", "https://otherplace.yourdomain.com/$1"), CF_TEMP_REDIRECT("example.mydomain.com/*", "https://otherplace.yourdomain.com/$1"),
); );
``` ```

View File

@ -23,13 +23,13 @@ backups and manually verifying `dnscontrol preview` output before running
`dnscontrol push`. `dnscontrol push`.
{% endhint %} {% endhint %}
This example assigns the patterns `api.foo.com/*` and `foo.com/api/*` to a `my-worker` script: This example assigns the patterns `api.example.com/*` and `example.com/api/*` to a `my-worker` script:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("foo.com", .... , D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
CF_WORKER_ROUTE("api.foo.com/*", "my-worker"), CF_WORKER_ROUTE("api.example.com/*", "my-worker"),
CF_WORKER_ROUTE("foo.com/api/*", "my-worker"), CF_WORKER_ROUTE("example.com/api/*", "my-worker"),
); );
``` ```
{% endcode %} {% endcode %}

View File

@ -17,7 +17,7 @@ Target should be a string representing the CNAME target. If it is a single label
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, DnsProvider("R53"), D("example.com", REG_MY_PROVIDER, DnsProvider("R53"),
CNAME("foo", "google.com."), // foo.example.com -> google.com CNAME("foo", "google.com."), // foo.example.com -> google.com
CNAME("abc", "@"), // abc.example.com -> example.com CNAME("abc", "@"), // abc.example.com -> example.com
CNAME("def", "test"), // def.example.com -> test.example.com CNAME("def", "test"), // def.example.com -> test.example.com

View File

@ -28,7 +28,7 @@ Digest must be a string.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, DnsProvider(R53), D("example.com", REG_MY_PROVIDER, DnsProvider(R53),
DS("example.com", 2371, 13, 2, "ABCDEF") DS("example.com", 2371, 13, 2, "ABCDEF")
); );
``` ```

View File

@ -14,13 +14,13 @@ NS records are currently a special case, and do not inherit from `DefaultTTL`. S
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D('example.com', REGISTRAR, DnsProvider('R53'), D("example.com", REG_MY_PROVIDER, DnsProvider("R53"),
DefaultTTL("4h"), DefaultTTL("4h"),
A('@','1.2.3.4'), // uses default A("@","1.2.3.4"), // uses default
A('foo', '2.3.4.5', TTL(600)) // overrides default A("foo", "2.3.4.5", TTL(600)) // overrides default
); );
``` ```
{% endcode %} {% endcode %}
The DefaultTTL duration is the same format as [`TTL`](../record/TTL.md), an integer number of seconds The DefaultTTL duration is the same format as [`TTL`](../record/TTL.md), an integer number of seconds
or a string with a unit such as `'4d'`. or a string with a unit such as `"4d"`.

View File

@ -36,7 +36,7 @@ In this example, DNSControl will insert/update the "baz.example.com" record but
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
IGNORE_NAME("foo"), // ignore all record types for name foo IGNORE_NAME("foo"), // ignore all record types for name foo
IGNORE_NAME("baz", "*"), // ignore all record types for name baz IGNORE_NAME("baz", "*"), // ignore all record types for name baz
IGNORE_NAME("bar", "A,MX"), // ignore only A and MX records for name bar IGNORE_NAME("bar", "A,MX"), // ignore only A and MX records for name bar
@ -87,7 +87,7 @@ is trying to insert.
You can override this error by adding the You can override this error by adding the
`IGNORE_NAME_DISABLE_SAFETY_CHECK` flag to the record. `IGNORE_NAME_DISABLE_SAFETY_CHECK` flag to the record.
TXT('vpn', "this thing", IGNORE_NAME_DISABLE_SAFETY_CHECK) TXT("vpn", "this thing", IGNORE_NAME_DISABLE_SAFETY_CHECK)
Disabling this safety check creates two risks: Disabling this safety check creates two risks:

View File

@ -34,8 +34,8 @@ In this example, DNSControl will insert/update the "baz.example.com" record but
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
IGNORE_TARGET('**.acm-validations.aws.', 'CNAME'), IGNORE_TARGET("**.acm-validations.aws.", "CNAME"),
A("baz", "1.2.3.4") A("baz", "1.2.3.4")
); );
``` ```

View File

@ -51,16 +51,16 @@ var TRANSFORM_INT = [
{ low: "2.4.6.80", high: "2.4.6.90", newBase: "123.123.123.200" }, // Another rule, just to show that you can have many. { low: "2.4.6.80", high: "2.4.6.90", newBase: "123.123.123.200" }, // Another rule, just to show that you can have many.
] ]
D("foo.com", .... , D("foo.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
A("one","1.2.3.1") A("one","1.2.3.1")
A("two","1.2.3.2") A("two","1.2.3.2")
A("three","1.2.3.13") A("three","1.2.3.13")
A("four","1.2.3.14") A("four","1.2.3.14")
); );
D("bar.com", .... , D("bar.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
A("www","123.123.123.123") A("www","123.123.123.123")
IMPORT_TRANSFORM(TRANSFORM_INT, 'foo.com', 300), IMPORT_TRANSFORM(TRANSFORM_INT, "foo.com", 300),
); );
``` ```
{% endcode %} {% endcode %}
@ -68,4 +68,4 @@ D("bar.com", .... ,
Transform rules are: RANGE_START, RANGE_END, NEW_BASE. NEW_BASE may be: Transform rules are: RANGE_START, RANGE_END, NEW_BASE. NEW_BASE may be:
* An IP address. Rebase the IP address on this IP address. Extract the host part of the /24 and add it to the "new base" address. * An IP address. Rebase the IP address on this IP address. Extract the host part of the /24 and add it to the "new base" address.
* A list of IP addresses. For each A record, inject an A record for each item in the list: `newBase: ['1.2.3.100', '2.4.6.8.100']` would produce 2 records for each A record. * A list of IP addresses. For each A record, inject an A record for each item in the list: `newBase: ["1.2.3.100", "2.4.6.8.100"]` would produce 2 records for each A record.

View File

@ -11,11 +11,11 @@ Includes all records from a given domain
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com!external", REGISTRAR, DnsProvider(R53), D("example.com!external", REG_MY_PROVIDER, DnsProvider(R53),
A("test", "8.8.8.8") A("test", "8.8.8.8")
); );
D("example.com!internal", REGISTRAR, DnsProvider(R53), D("example.com!internal", REG_MY_PROVIDER, DnsProvider(R53),
INCLUDE("example.com!external"), INCLUDE("example.com!external"),
A("home", "127.0.0.1") A("home", "127.0.0.1")
); );

View File

@ -102,7 +102,7 @@ The coordinate format for `LOC()` is:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("foo.com","none" D("example.com","none"
// LOC "subdomain", d1, m1, s1, "[NnSs]", d2, m2, s2, "[EeWw]", alt, siz, hp, vp) // LOC "subdomain", d1, m1, s1, "[NnSs]", d2, m2, s2, "[EeWw]", alt, siz, hp, vp)
//42 21 54 N 71 06 18 W -24m 30m //42 21 54 N 71 06 18 W -24m 30m
, LOC("@", 42, 21, 54, "N", 71, 6, 18, "W", -24, 30, 0, 0) , LOC("@", 42, 21, 54, "N", 71, 6, 18, "W", -24, 30, 0, 0)

View File

@ -20,7 +20,7 @@ Target should be a string representing the MX target. If it is a single label we
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, DnsProvider(R53), D("example.com", REG_MY_PROVIDER, DnsProvider(R53),
MX("@", 5, "mail"), // mx example.com -> mail.example.com MX("@", 5, "mail"), // mx example.com -> mail.example.com
MX("sub", 10, "mail.foo.com.") MX("sub", 10, "mail.foo.com.")
); );

View File

@ -8,7 +8,7 @@ parameter_types:
"modifiers...": RecordModifier[] "modifiers...": RecordModifier[]
--- ---
`NAMESERVER()` instructs DNSControl to inform the domain's registrar where to find this zone. `NAMESERVER()` instructs DNSControl to inform the domain"s registrar where to find this zone.
For some registrars this will also add NS records to the zone itself. For some registrars this will also add NS records to the zone itself.
This takes exactly one argument: the name of the nameserver. It must end with This takes exactly one argument: the name of the nameserver. It must end with
@ -22,14 +22,14 @@ For more information, refer to [this page](../../nameservers.md).
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, .... , D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
DnsProvider(route53, 0), DnsProvider(route53, 0),
// Replace the nameservers: // Replace the nameservers:
NAMESERVER("ns1.myserver.com."), NAMESERVER("ns1.myserver.com."),
NAMESERVER("ns2.myserver.com."), NAMESERVER("ns2.myserver.com."),
); );
D("example2.com", REGISTRAR, .... , D("example2.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
// Add these two additional nameservers to the existing list of nameservers. // Add these two additional nameservers to the existing list of nameservers.
NAMESERVER("ns1.myserver.com."), NAMESERVER("ns1.myserver.com."),
NAMESERVER("ns2.myserver.com."), NAMESERVER("ns2.myserver.com."),
@ -56,7 +56,7 @@ the registrar who does the hard work of talking to the people that
control `.com`. If the domain was `gmeet.io`, the registrar does control `.com`. If the domain was `gmeet.io`, the registrar does
the right thing to talk to the people that control `.io`. the right thing to talk to the people that control `.io`.
(A better name might have been `PARENTNAMESERVER()` but we didn't (A better name might have been `PARENTNAMESERVER()` but we didn"t
think of that at the time.) think of that at the time.)
Each registrar handles delegations differently. Most use Each registrar handles delegations differently. Most use
@ -82,7 +82,7 @@ It looks like this:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var REG_THIRDPARTY = NewRegistrar('ThirdParty', 'NONE') var REG_THIRDPARTY = NewRegistrar("ThirdParty");
D("mydomain.com", REG_THIRDPARTY, D("mydomain.com", REG_THIRDPARTY,
... ...
) )

View File

@ -14,24 +14,24 @@ The value can be an integer or a string. See [`TTL`](../record/TTL.md) for examp
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D('example.com', REGISTRAR, DnsProvider('R53'), D("example.com", REG_MY_PROVIDER, DnsProvider("R53"),
NAMESERVER_TTL('2d'), NAMESERVER_TTL("2d"),
NAMESERVER('ns') NAMESERVER("ns")
); );
``` ```
{% endcode %} {% endcode %}
Use `NAMESERVER_TTL('3600'),` or `NAMESERVER_TTL('1h'),` for a 1h default TTL for all subsequent `NS` entries: Use `NAMESERVER_TTL("3600"),` or `NAMESERVER_TTL("1h"),` for a 1h default TTL for all subsequent `NS` entries:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D('example.com', REGISTRAR, DnsProvider('xyz'), D("example.com", REG_MY_PROVIDER, DnsProvider("xyz"),
DefaultTTL("4h"), DefaultTTL("4h"),
NAMESERVER_TTL('3600'), NAMESERVER_TTL("3600"),
NAMESERVER('ns1.provider.com.'), //inherits NAMESERVER_TTL NAMESERVER("ns1.provider.com."), //inherits NAMESERVER_TTL
NAMESERVER('ns2.provider.com.'), //inherits NAMESERVER_TTL NAMESERVER("ns2.provider.com."), //inherits NAMESERVER_TTL
A('@','1.2.3.4'), // inherits DefaultTTL A("@","1.2.3.4"), // inherits DefaultTTL
A('foo', '2.3.4.5', TTL(600)) // overrides DefaultTTL for this record only A("foo", "2.3.4.5", TTL(600)) // overrides DefaultTTL for this record only
); );
``` ```
{% endcode %} {% endcode %}

View File

@ -157,16 +157,16 @@ Individual e164 records
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("3.2.1.5.5.5.0.0.8.1.e164.arpa.", REGISTRAR, DnsProvider(R53), D("3.2.1.5.5.5.0.0.8.1.e164.arpa.", REG_MY_PROVIDER, DnsProvider(R53),
NAPTR('1', 10, 10, "u", "E2U+SIP", "!^.*$!sip:bob@example.com!", "."), NAPTR("1", 10, 10, "u", "E2U+SIP", "!^.*$!sip:bob@example.com!", "."),
NAPTR('2', 10, 10, "u", "E2U+SIP", "!^.*$!sip:alice@example.com!", "."), NAPTR("2", 10, 10, "u", "E2U+SIP", "!^.*$!sip:alice@example.com!", "."),
NAPTR('4', 10, 10, "u", "E2U+SIP", "!^.*$!sip:kate@example.com!", "."), NAPTR("4", 10, 10, "u", "E2U+SIP", "!^.*$!sip:kate@example.com!", "."),
NAPTR('5', 10, 10, "u", "E2U+SIP", "!^.*$!sip:steve@example.com!", "."), NAPTR("5", 10, 10, "u", "E2U+SIP", "!^.*$!sip:steve@example.com!", "."),
NAPTR('6', 10, 10, "u", "E2U+SIP", "!^.*$!sip:joe@example.com!", "."), NAPTR("6", 10, 10, "u", "E2U+SIP", "!^.*$!sip:joe@example.com!", "."),
NAPTR('7', 10, 10, "u", "E2U+SIP", "!^.*$!sip:jane@example.com!", "."), NAPTR("7", 10, 10, "u", "E2U+SIP", "!^.*$!sip:jane@example.com!", "."),
NAPTR('8', 10, 10, "u", "E2U+SIP", "!^.*$!sip:mike@example.com!", "."), NAPTR("8", 10, 10, "u", "E2U+SIP", "!^.*$!sip:mike@example.com!", "."),
NAPTR('9', 10, 10, "u", "E2U+SIP", "!^.*$!sip:linda@example.com!", "."), NAPTR("9", 10, 10, "u", "E2U+SIP", "!^.*$!sip:linda@example.com!", "."),
NAPTR('0', 10, 10, "u", "E2U+SIP", "!^.*$!sip:fax@example.com!", ".") NAPTR("0", 10, 10, "u", "E2U+SIP", "!^.*$!sip:fax@example.com!", ".")
); );
``` ```
{% endcode %} {% endcode %}
@ -174,10 +174,10 @@ D("3.2.1.5.5.5.0.0.8.1.e164.arpa.", REGISTRAR, DnsProvider(R53),
Single e164 zone Single e164 zone
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("4.3.2.1.5.5.5.0.0.8.1.e164.arpa.", REGISTRAR, DnsProvider(R53), D("4.3.2.1.5.5.5.0.0.8.1.e164.arpa.", REG_MY_PROVIDER, DnsProvider(R53),
NAPTR('@', 100, 50, "u", "E2U+SIP", "!^.*$!sip:customer-service@example.com!", "."), NAPTR("@", 100, 50, "u", "E2U+SIP", "!^.*$!sip:customer-service@example.com!", "."),
NAPTR('@', 101, 50, "u", "E2U+email", "!^.*$!mailto:information@example.com!", "."), NAPTR("@", 101, 50, "u", "E2U+email", "!^.*$!mailto:information@example.com!", "."),
NAPTR('@', 101, 50, "u", "smtp+E2U", "!^.*$!mailto:information@example.com!", ".") NAPTR("@", 101, 50, "u", "smtp+E2U", "!^.*$!mailto:information@example.com!", ".")
); );
``` ```
{% endcode %} {% endcode %}
@ -187,17 +187,17 @@ D("4.3.2.1.5.5.5.0.0.8.1.e164.arpa.", REGISTRAR, DnsProvider(R53),
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, DnsProvider(R53), D("example.com", REG_MY_PROVIDER, DnsProvider(R53),
NAPTR('@', 20, 50, "s", "SIPS+D2T", "", "_sips._tcp.example.com."), NAPTR("@", 20, 50, "s", "SIPS+D2T", "", "_sips._tcp.example.com."),
NAPTR('@', 20, 50, "s", "SIP+D2T", "", "_sip._tcp.example.com."), NAPTR("@", 20, 50, "s", "SIP+D2T", "", "_sip._tcp.example.com."),
NAPTR('@', 30, 50, "s", "SIP+D2U", "", "_sip._udp.example.com."), NAPTR("@", 30, 50, "s", "SIP+D2U", "", "_sip._udp.example.com."),
NAPTR('help', 100, 50, "s", "SIP+D2U", "!^.*$!sip:customer-service@example.com!", "_sip._udp.example.com."), NAPTR("help", 100, 50, "s", "SIP+D2U", "!^.*$!sip:customer-service@example.com!", "_sip._udp.example.com."),
NAPTR('help', 101, 50, "s", "SIP+D2T", "!^.*$!sip:customer-service@example.com!", "_sip._tcp.example.com."), NAPTR("help", 101, 50, "s", "SIP+D2T", "!^.*$!sip:customer-service@example.com!", "_sip._tcp.example.com."),
SRV('_sip._udp', 100, 0, 5060, 'sip.example.com.'), SRV("_sip._udp", 100, 0, 5060, "sip.example.com."),
SRV('_sip._tcp', 100, 0, 5060, 'sip.example.com.'), SRV("_sip._tcp", 100, 0, 5060, "sip.example.com."),
SRV('_sips._tcp', 100, 0, 5061, 'sip.example.com.'), SRV("_sips._tcp", 100, 0, 5061, "sip.example.com."),
A('sip', '192.0.2.2'), A("sip", "192.0.2.2"),
AAAA('sip', '2001:db8::85a3'), AAAA("sip", "2001:db8::85a3"),
// and so on // and so on
); );
``` ```
@ -208,14 +208,14 @@ D("example.com", REGISTRAR, DnsProvider(R53),
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, DnsProvider(R53), D("example.com", REG_MY_PROVIDER, DnsProvider(R53),
NAPTR('@',100, 50, "a", "z3950+N2L+N2C", "", "cidserver.example.com."), NAPTR("@",100, 50, "a", "z3950+N2L+N2C", "", "cidserver.example.com."),
NAPTR('@', 50, 50, "a", "rcds+N2C", "", "cidserver.example.com."), NAPTR("@", 50, 50, "a", "rcds+N2C", "", "cidserver.example.com."),
NAPTR('@', 30, 50, "s", "http+N2L+N2C+N2R", "", "www.example.com."), NAPTR("@", 30, 50, "s", "http+N2L+N2C+N2R", "", "www.example.com."),
NAPTR('www',100,100, "s", "http+I2R", "", "_http._tcp.example.com."), NAPTR("www",100,100, "s", "http+I2R", "", "_http._tcp.example.com."),
NAPTR('www',100,100, "s", "ftp+I2R", "", "_ftp._tcp.example.com."), NAPTR("www",100,100, "s", "ftp+I2R", "", "_ftp._tcp.example.com."),
SRV('_z3950._tcp', 0, 0, 1000, 'z3950.beast.example.com.'), SRV("_z3950._tcp", 0, 0, 1000, "z3950.beast.example.com."),
SRV('_http._tcp', 10, 0, 80, 'foo.example.com.'), SRV("_http._tcp", 10, 0, 80, "foo.example.com."),
// and so on // and so on
); );
``` ```

View File

@ -27,7 +27,7 @@ in place.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", .... , NO_PURGE, D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER), NO_PURGE,
A("foo","1.2.3.4") A("foo","1.2.3.4")
); );
``` ```

View File

@ -20,7 +20,7 @@ Target should be a string representing the NS target. If it is a single label we
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, DnsProvider("R53"), D("example.com", REG_MY_PROVIDER, DnsProvider("R53"),
NS("foo", "ns1.example2.com."), // Delegate ".foo.example.com" zone to another server. NS("foo", "ns1.example2.com."), // Delegate ".foo.example.com" zone to another server.
NS("foo", "ns2.example2.com."), // Delegate ".foo.example.com" zone to another server. NS("foo", "ns2.example2.com."), // Delegate ".foo.example.com" zone to another server.
A("ns1.example2.com", "10.10.10.10"), // Glue records A("ns1.example2.com", "10.10.10.10"), // Glue records

View File

@ -32,8 +32,8 @@ IPv6 is properly handled too.
*Extra Validation:* DNSControl considers it an error to include a name that *Extra Validation:* DNSControl considers it an error to include a name that
is inappropriate for the domain. For example is inappropriate for the domain. For example
`PTR('1.2.3.4', 'f.co.')` is valid for the domain `D("3.2.1.in-addr.arpa',` `PTR("1.2.3.4", "f.co.")` is valid for the domain `D("3.2.1.in-addr.arpa",`
but DNSControl will generate an error if the domain is `D("9.9.9.in-addr.arpa',`. but DNSControl will generate an error if the domain is `D("9.9.9.in-addr.arpa",`.
This is because `1.2.3.4` is contained in `1.2.3.0/24` but not `9.9.9.0/24`. This is because `1.2.3.4` is contained in `1.2.3.0/24` but not `9.9.9.0/24`.
This validation works for IPv6, IPv4, and This validation works for IPv6, IPv4, and
RFC2317 "Classless in-addr.arpa delegation" domains. RFC2317 "Classless in-addr.arpa delegation" domains.
@ -45,12 +45,12 @@ name is contained within the CIDR block implied by domain. For example
if name is `4.3.2.1.in-addr.arpa.` (note the trailing `.`) if name is `4.3.2.1.in-addr.arpa.` (note the trailing `.`)
and the domain is `2.1.in-addr.arpa` (no trailing `.`) and the domain is `2.1.in-addr.arpa` (no trailing `.`)
then the name will be replaced with `4.3`. Note that the output then the name will be replaced with `4.3`. Note that the output
of `REV('1.2.3.4')` is `4.3.2.1.in-addr.arpa.`, which means the following of `REV("1.2.3.4")` is `4.3.2.1.in-addr.arpa.`, which means the following
are all equivalent: are all equivalent:
* `PTR(REV('1.2.3.4'), ` * `PTR(REV("1.2.3.4"), `
* `PTR('4.3.2.1.in-addr.arpa.'), ` * `PTR("4.3.2.1.in-addr.arpa."), `
* `PTR('4.3',` // Assuming the domain is `2.1.in-addr.arpa` * `PTR("4.3",` // Assuming the domain is `2.1.in-addr.arpa`
All magic is RFC2317-aware. We use the first format listed in the All magic is RFC2317-aware. We use the first format listed in the
RFC for both [`REV()`](../global/REV.md) and `PTR()`. The format is RFC for both [`REV()`](../global/REV.md) and `PTR()`. The format is
@ -62,31 +62,31 @@ and A, B, C are the first 3 octets of the IP address. For example
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D(REV('1.2.3.0/24'), REGISTRAR, DnsProvider(BIND), D(REV("1.2.3.0/24"), REGISTRAR, DnsProvider(BIND),
PTR('1', 'foo.example.com.'), PTR("1", "foo.example.com."),
PTR('2', 'bar.example.com.'), PTR("2", "bar.example.com."),
PTR('3', 'baz.example.com.'), PTR("3", "baz.example.com."),
// If the first parameter is a valid IP address, DNSControl will generate the correct name: // If the first parameter is a valid IP address, DNSControl will generate the correct name:
PTR('1.2.3.10', 'ten.example.com.'), // '10' PTR("1.2.3.10", "ten.example.com."), // "10"
); );
``` ```
{% endcode %} {% endcode %}
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D(REV('9.9.9.128/25'), REGISTRAR, DnsProvider(BIND), D(REV("9.9.9.128/25"), REGISTRAR, DnsProvider(BIND),
PTR('9.9.9.129', 'first.example.com.'), PTR("9.9.9.129", "first.example.com."),
); );
``` ```
{% endcode %} {% endcode %}
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D(REV('2001:db8:302::/48'), REGISTRAR, DnsProvider(BIND), D(REV("2001:db8:302::/48"), REGISTRAR, DnsProvider(BIND),
PTR('1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0', 'foo.example.com.'), // 2001:db8:302::1 PTR("1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0", "foo.example.com."), // 2001:db8:302::1
// If the first parameter is a valid IP address, DNSControl will generate the correct name: // If the first parameter is a valid IP address, DNSControl will generate the correct name:
PTR('2001:db8:302::2', 'two.example.com.'), // '2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0' PTR("2001:db8:302::2", "two.example.com."), // "2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0"
PTR('2001:db8:302::3', 'three.example.com.'), // '3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0' PTR("2001:db8:302::3", "three.example.com."), // "3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0"
); );
``` ```
{% endcode %} {% endcode %}

View File

@ -14,7 +14,7 @@ These three examples all are equivalent.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", .... , D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
); );
``` ```
{% endcode %} {% endcode %}
@ -23,7 +23,7 @@ Purge is the default, but we set it anyway:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", .... , D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
PURGE, PURGE,
); );
``` ```
@ -33,7 +33,7 @@ Since the "last command wins", this is the same as `PURGE`:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", .... , D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
PURGE, PURGE,
NO_PURGE, NO_PURGE,
PURGE, PURGE,

View File

@ -39,12 +39,12 @@ The zone id can be found depending on the target type:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D('example.com', REGISTRAR, DnsProvider('ROUTE53'), D("example.com", REG_MY_PROVIDER, DnsProvider("ROUTE53"),
R53_ALIAS('foo', 'A', 'bar'), // record in same zone R53_ALIAS("foo", "A", "bar"), // record in same zone
R53_ALIAS('foo', 'A', 'bar', R53_ZONE('Z35SXDOTRQ7X7K')), // record in same zone, zone specified R53_ALIAS("foo", "A", "bar", R53_ZONE("Z35SXDOTRQ7X7K")), // record in same zone, zone specified
R53_ALIAS('foo', 'A', 'blahblah.elasticloadbalancing.us-west-1.amazonaws.com.', R53_ZONE('Z368ELLRRE2KJ0')), // a classic ELB in us-west-1 R53_ALIAS("foo", "A", "blahblah.elasticloadbalancing.us-west-1.amazonaws.com.", R53_ZONE("Z368ELLRRE2KJ0")), // a classic ELB in us-west-1
R53_ALIAS('foo', 'A', 'blahblah.elasticbeanstalk.us-west-2.amazonaws.com.', R53_ZONE('Z38NKT9BP95V3O')), // an Elastic Beanstalk environment in us-west-2 R53_ALIAS("foo", "A", "blahblah.elasticbeanstalk.us-west-2.amazonaws.com.", R53_ZONE("Z38NKT9BP95V3O")), // an Elastic Beanstalk environment in us-west-2
R53_ALIAS('foo', 'A', 'blahblah-bucket.s3-website-us-west-1.amazonaws.com.', R53_ZONE('Z2F56UZL2M1ACD')), // a website S3 Bucket in us-west-1 R53_ALIAS("foo", "A", "blahblah-bucket.s3-website-us-west-1.amazonaws.com.", R53_ZONE("Z2F56UZL2M1ACD")), // a website S3 Bucket in us-west-1
); );
``` ```
{% endcode %} {% endcode %}

View File

@ -24,7 +24,7 @@ parameter_types:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REG_THIRDPARTY, DnsProvider("DNS_BIND"), D("example.com", REG_MY_PROVIDER, DnsProvider("DNS_BIND"),
SOA("@", "ns3.example.org.", "hostmaster@example.org", 3600, 600, 604800, 1440), SOA("@", "ns3.example.org.", "hostmaster@example.org", 3600, 600, 604800, 1440),
); );
``` ```

View File

@ -22,11 +22,11 @@ Priority, weight, and port are ints.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, DnsProvider("GCLOUD"), D("example.com", REG_MY_PROVIDER, DnsProvider("GCLOUD"),
// Create SRV records for a a SIP service: // Create SRV records for a a SIP service:
// pr w port, target // pr w port, target
SRV('_sip._tcp', 10, 60, 5060, 'bigbox.example.tld.'), SRV("_sip._tcp", 10, 60, 5060, "bigbox.example.tld."),
SRV('_sip._tcp', 10, 20, 5060, 'smallbox1.example.tld.'), SRV("_sip._tcp", 10, 20, 5060, "smallbox1.example.tld."),
); );
``` ```
{% endcode %} {% endcode %}

View File

@ -38,6 +38,6 @@ parameter_types:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
SSHFP('@', 1, 1, '00yourAmazingFingerprint00'), SSHFP("@", 1, 1, "00yourAmazingFingerprint00"),
``` ```
{% endcode %} {% endcode %}

View File

@ -24,7 +24,7 @@ Certificate is a hex string.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, DnsProvider("GCLOUD"), D("example.com", REG_MY_PROVIDER, DnsProvider("GCLOUD"),
// Create TLSA record for certificate used on TCP port 443 // Create TLSA record for certificate used on TCP port 443
TLSA("_443._tcp", 3, 1, 1, "abcdef0"), TLSA("_443._tcp", 3, 1, 1, "abcdef0"),
); );

View File

@ -24,13 +24,13 @@ Modifiers can be any number of [record modifiers](https://docs.dnscontrol.org/la
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.com", REGISTRAR, ...., D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
TXT('@', '598611146-3338560'), TXT("@", "598611146-3338560"),
TXT('listserve', 'google-site-verification=12345'), TXT("listserve", "google-site-verification=12345"),
TXT('multiple', ['one', 'two', 'three']), // Multiple strings TXT("multiple", ["one", "two", "three"]), // Multiple strings
TXT('quoted', 'any "quotes" and escapes? ugh; no worries!'), TXT("quoted", "any "quotes" and escapes? ugh; no worries!"),
TXT('_domainkey', 't=y; o=-;'), // Escapes are done for you automatically. TXT("_domainkey", "t=y; o=-;"), // Escapes are done for you automatically.
TXT('long', 'X'.repeat(300)) // Long strings are split automatically. TXT("long", "X".repeat(300)) // Long strings are split automatically.
); );
``` ```
{% endcode %} {% endcode %}

View File

@ -23,22 +23,22 @@ Modifier arguments are processed according to type as follows:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var REGISTRAR = NewRegistrar("name.com"); var REG_NAMECOM = NewRegistrar("name.com");
var r53 = NewDnsProvider("R53"); var r53 = NewDnsProvider("R53");
// simple domain // simple domain
D("example.com", REGISTRAR, DnsProvider(r53), D("example.com", REG_NAMECOM, DnsProvider(r53),
A("@","1.2.3.4"), A("@","1.2.3.4"),
CNAME("test", "foo.example2.com.") CNAME("test", "foo.example2.com.")
); );
// "macro" for records that can be mixed into any zone // "macro" for records that can be mixed into any zone
var GOOGLE_APPS_DOMAIN_MX = [ var GOOGLE_APPS_DOMAIN_MX = [
MX('@', 1, 'aspmx.l.google.com.'), MX("@", 1, "aspmx.l.google.com."),
MX('@', 5, 'alt1.aspmx.l.google.com.'), MX("@", 5, "alt1.aspmx.l.google.com."),
MX('@', 5, 'alt2.aspmx.l.google.com.'), MX("@", 5, "alt2.aspmx.l.google.com."),
MX('@', 10, 'alt3.aspmx.l.google.com.'), MX("@", 10, "alt3.aspmx.l.google.com."),
MX('@', 10, 'alt4.aspmx.l.google.com.'), MX("@", 10, "alt4.aspmx.l.google.com."),
] ]
D("example.com", REGISTRAR, DnsProvider(r53), D("example.com", REGISTRAR, DnsProvider(r53),
@ -62,15 +62,15 @@ To differentiate the different domains, specify the domains as
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var REG = NewRegistrar("Third-Party"); var REG_THIRDPARTY = NewRegistrar("ThirdParty");
var DNS_INSIDE = NewDnsProvider("Cloudflare"); var DNS_INSIDE = NewDnsProvider("Cloudflare");
var DNS_OUTSIDE = NewDnsProvider("bind"); var DNS_OUTSIDE = NewDnsProvider("bind");
D("example.com!inside", REG, DnsProvider(DNS_INSIDE), D("example.com!inside", REG_THIRDPARTY, DnsProvider(DNS_INSIDE),
A("www", "10.10.10.10") A("www", "10.10.10.10")
); );
D("example.com!outside", REG, DnsProvider(DNS_OUTSIDE), D("example.com!outside", REG_THIRDPARTY, DnsProvider(DNS_OUTSIDE),
A("www", "20.20.20.20") A("www", "20.20.20.20")
); );
@ -94,7 +94,7 @@ define domains `example.com!george` and `example.com!john` then:
* `--domains=example.com` will not match either domain. * `--domains=example.com` will not match either domain.
* `--domains='example.com!george'` will match only match the first. * `--domains='example.com!george'` will match only match the first.
* `--domains='example.com!george',example.com!john` will match both. * `--domains='example.com!george",example.com!john` will match both.
{% hint style="info" %} {% hint style="info" %}
**NOTE**: The quotes are required if your shell treats `!` as a special **NOTE**: The quotes are required if your shell treats `!` as a special

View File

@ -19,7 +19,7 @@ The domain `example.com` will have the defaults set.
var COMMON = NewDnsProvider("foo"); var COMMON = NewDnsProvider("foo");
DEFAULTS( DEFAULTS(
DnsProvider(COMMON, 0), DnsProvider(COMMON, 0),
DefaultTTL('1d') DefaultTTL("1d")
); );
D("example.com", D("example.com",

View File

@ -25,7 +25,7 @@ names (labels), and targets (as appropriate). See the examples below.
Matching the domain name to previously-defined domains is done using a Matching the domain name to previously-defined domains is done using a
`longest match` algorithm. If `domain.tld` and `sub.domain.tld` are `longest match` algorithm. If `domain.tld` and `sub.domain.tld` are
defined as separate domains via separate [`D()`](D.md) statements, then defined as separate domains via separate [`D()`](D.md) statements, then
`D_EXTEND('sub.sub.domain.tld', ...)` would match `sub.domain.tld`, `D_EXTEND("sub.sub.domain.tld", ...)` would match `sub.domain.tld`,
not `domain.tld`. not `domain.tld`.
Some operators only act on an apex domain (e.g. Some operators only act on an apex domain (e.g.
@ -34,7 +34,7 @@ in a `D_EXTEND` subdomain may not be what you expect.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("domain.tld", REG, DnsProvider(DNS), D("domain.tld", REG_MY_PROVIDER, DnsProvider(DNS),
A("@", "127.0.0.1"), // domain.tld A("@", "127.0.0.1"), // domain.tld
A("www", "127.0.0.2"), // www.domain.tld A("www", "127.0.0.2"), // www.domain.tld
CNAME("a", "b") // a.domain.tld -> b.domain.tld CNAME("a", "b") // a.domain.tld -> b.domain.tld

View File

@ -22,14 +22,14 @@ Otherwise the syntax of `FETCH` is the same as `fetch`.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var REG_NONE = NewRegistrar('none'); var REG_NONE = NewRegistrar("none");
var DNS_BIND = NewDnsProvider('bind'); var DNS_BIND = NewDnsProvider("bind");
D('example.com', REG_NONE, DnsProvider(DNS_BIND), [ D("example.com", REG_NONE, DnsProvider(DNS_BIND), [
A('@', '1.2.3.4'), A("@", "1.2.3.4"),
]); ]);
FETCH('https://example.com', { FETCH("https://example.com", {
// All three options below are optional // All three options below are optional
headers: {"X-Authentication": "barfoo"}, headers: {"X-Authentication": "barfoo"},
method: "POST", method: "POST",
@ -38,8 +38,8 @@ FETCH('https://example.com', {
return r.text(); return r.text();
}).then(function(t) { }).then(function(t) {
// Example of generating record based on response // Example of generating record based on response
D_EXTEND('example.com', [ D_EXTEND("example.com", [
TXT('@', t.slice(0, 100)), TXT("@", t.slice(0, 100)),
]); ]);
}); });
``` ```

View File

@ -11,7 +11,7 @@ Converts an IPv4 address from string to an integer. This allows performing mathe
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var addrA = IP('1.2.3.4') var addrA = IP("1.2.3.4")
var addrB = addrA + 1 var addrB = addrA + 1
// addrB = 1.2.3.5 // addrB = 1.2.3.5
``` ```

View File

@ -12,7 +12,7 @@ example `REV('1.2.3.0/24')` returns `3.2.1.in-addr.arpa.` and
`REV('2001:db8:302::/48)` returns `2.0.3.0.8.b.d.0.1.0.0.2.ip6.arpa.`. `REV('2001:db8:302::/48)` returns `2.0.3.0.8.b.d.0.1.0.0.2.ip6.arpa.`.
This is used in [`D()`](D.md) functions to create reverse DNS lookup zones. This is used in [`D()`](D.md) functions to create reverse DNS lookup zones.
This is a convenience function. You could specify `D('3.2.1.in-addr.arpa', This is a convenience function. You could specify `D("3.2.1.in-addr.arpa",
...` if you like to do things manually but why would you risk making ...` if you like to do things manually but why would you risk making
typos? typos?
@ -29,24 +29,24 @@ If the address does not include a "/" then `REV` assumes /32 for IPv4 addresses
and /128 for IPv6 addresses. and /128 for IPv6 addresses.
Note that the lower bits (the ones outside the netmask) must be zeros. They are not Note that the lower bits (the ones outside the netmask) must be zeros. They are not
zeroed out automatically. Thus, `REV('1.2.3.4/24')` is an error. This is done zeroed out automatically. Thus, `REV("1.2.3.4/24")` is an error. This is done
to catch typos. to catch typos.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D(REV('1.2.3.0/24'), REGISTRAR, DnsProvider(BIND), D(REV("1.2.3.0/24"), REGISTRAR, DnsProvider(BIND),
PTR("1", 'foo.example.com.'), PTR("1", "foo.example.com."),
PTR("2", 'bar.example.com.'), PTR("2", "bar.example.com."),
PTR("3", 'baz.example.com.'), PTR("3", "baz.example.com."),
// These take advantage of DNSControl's ability to generate the right name: // These take advantage of DNSControl's ability to generate the right name:
PTR("1.2.3.10", 'ten.example.com.'), PTR("1.2.3.10", "ten.example.com."),
); );
D(REV('2001:db8:302::/48'), REGISTRAR, DnsProvider(BIND), D(REV("2001:db8:302::/48"), REGISTRAR, DnsProvider(BIND),
PTR("1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0", 'foo.example.com.'), // 2001:db8:302::1 PTR("1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0", "foo.example.com."), // 2001:db8:302::1
// These take advantage of DNSControl's ability to generate the right name: // These take advantage of DNSControl's ability to generate the right name:
PTR("2001:db8:302::2", 'two.example.com.'), // 2.0.0... PTR("2001:db8:302::2", "two.example.com."), // 2.0.0...
PTR("2001:db8:302::3", 'three.example.com.'), // 3.0.0... PTR("2001:db8:302::3", "three.example.com."), // 3.0.0...
); );
``` ```
{% endcode %} {% endcode %}

View File

@ -15,7 +15,7 @@ Example for adding records to all configured domains:
var domains = getConfiguredDomains(); var domains = getConfiguredDomains();
for(i = 0; i < domains.length; i++) { for(i = 0; i < domains.length; i++) {
D_EXTEND(domains[i], D_EXTEND(domains[i],
TXT('_important', 'BLA') // I know, not really creative. TXT("_important", "BLA") // I know, not really creative.
) )
} }
``` ```
@ -47,7 +47,7 @@ This example might be more useful, specially for configuring the DMARC report re
var domains = getConfiguredDomains(); var domains = getConfiguredDomains();
for(i = 0; i < domains.length; i++) { for(i = 0; i < domains.length; i++) {
D_EXTEND("domain1.tld", D_EXTEND("domain1.tld",
TXT(domains[i] + '._report._dmarc', 'v=DMARC1') TXT(domains[i] + "._report._dmarc", "v=DMARC1")
); );
} }
``` ```

View File

@ -21,9 +21,9 @@ of the call.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
require('kubernetes/clusters.js'); require("kubernetes/clusters.js");
D("mydomain.net", REG, PROVIDER, D("mydomain.net", REG_MY_PROVIDER, PROVIDER,
IncludeKubernetes() IncludeKubernetes()
); );
``` ```
@ -31,8 +31,8 @@ D("mydomain.net", REG, PROVIDER,
{% code title="kubernetes/clusters.js" %} {% code title="kubernetes/clusters.js" %}
```javascript ```javascript
require('./clusters/prod.js'); require("./clusters/prod.js");
require('./clusters/dev.js'); require("./clusters/dev.js");
function IncludeKubernetes() { function IncludeKubernetes() {
return [includeK8Sprod(), includeK8Sdev()]; return [includeK8Sprod(), includeK8Sdev()];
@ -64,10 +64,10 @@ You can also use it to require JSON files and initialize variables with it:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var domains = require('./domain-ip-map.json') var domains = require("./domain-ip-map.json")
for (var domain in domains) { for (var domain in domains) {
D(domain, REG, PROVIDER, D(domain, REG_MY_PROVIDER, PROVIDER,
A("@", domains[domain]) A("@", domains[domain])
); );
} }

View File

@ -42,9 +42,9 @@ DMARC policies for your domains.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
DMARC_BUILDER({ DMARC_BUILDER({
policy: 'reject', policy: "reject",
ruf: [ ruf: [
'mailto:mailauth-reports@example.com', "mailto:mailauth-reports@example.com",
], ],
}) })
``` ```
@ -61,20 +61,20 @@ This yield the following record:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
DMARC_BUILDER({ DMARC_BUILDER({
policy: 'reject', policy: "reject",
subdomainPolicy: 'quarantine', subdomainPolicy: "quarantine",
percent: 50, percent: 50,
alignmentSPF: 'r', alignmentSPF: "r",
alignmentDKIM: 'strict', alignmentDKIM: "strict",
rua: [ rua: [
'mailto:mailauth-reports@example.com', "mailto:mailauth-reports@example.com",
'https://dmarc.example.com/submit', "https://dmarc.example.com/submit",
], ],
ruf: [ ruf: [
'mailto:mailauth-reports@example.com', "mailto:mailauth-reports@example.com",
], ],
failureOptions: '1', failureOptions: "1",
reportInterval: '1h', reportInterval: "1h",
}); });
``` ```
{% endcode %} {% endcode %}
@ -82,10 +82,10 @@ DMARC_BUILDER({
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
DMARC_BUILDER({ DMARC_BUILDER({
label: 'insecure', label: "insecure",
policy: 'none', policy: "none",
ruf: [ ruf: [
'mailto:mailauth-reports@example.com', "mailto:mailauth-reports@example.com",
], ],
failureOptions: { failureOptions: {
SPF: false, SPF: false,
@ -105,17 +105,17 @@ insecure IN TXT "v=DMARC1; p=none; ruf=mailto:mailauth-reports@example.com;
### Parameters ### Parameters
* `label:` The DNS label for the DMARC record (`_dmarc` prefix is added, default: `'@'`) * `label:` The DNS label for the DMARC record (`_dmarc` prefix is added, default: `"@"`)
* `version:` The DMARC version to be used (default: `DMARC1`) * `version:` The DMARC version to be used (default: `DMARC1`)
* `policy:` The DMARC policy (`p=`), must be one of `'none'`, `'quarantine'`, `'reject'` * `policy:` The DMARC policy (`p=`), must be one of `"none"`, `"quarantine"`, `"reject"`
* `subdomainPolicy:` The DMARC policy for subdomains (`sp=`), must be one of `'none'`, `'quarantine'`, `'reject'` (optional) * `subdomainPolicy:` The DMARC policy for subdomains (`sp=`), must be one of `"none"`, `"quarantine"`, `"reject"` (optional)
* `alignmentSPF:` `'strict'`/`'s'` or `'relaxed'`/`'r'` alignment for SPF (`aspf=`, default: `'r'`) * `alignmentSPF:` `"strict"`/`"s"` or `"relaxed"`/`"r"` alignment for SPF (`aspf=`, default: `"r"`)
* `alignmentDKIM:` `'strict'`/`'s'` or `'relaxed'`/`'r'` alignment for DKIM (`adkim=`, default: `'r'`) * `alignmentDKIM:` `"strict"`/`"s"` or `"relaxed"`/`"r"` alignment for DKIM (`adkim=`, default: `"r"`)
* `percent:` Number between `0` and `100`, percentage for which policies are applied (`pct=`, default: `100`) * `percent:` Number between `0` and `100`, percentage for which policies are applied (`pct=`, default: `100`)
* `rua:` Array of aggregate report targets (optional) * `rua:` Array of aggregate report targets (optional)
* `ruf:` Array of failure report targets (optional) * `ruf:` Array of failure report targets (optional)
* `failureOptions:` Object or string; Object containing booleans `SPF` and `DKIM`, string is passed raw (`fo=`, default: `'0'`) * `failureOptions:` Object or string; Object containing booleans `SPF` and `DKIM`, string is passed raw (`fo=`, default: `"0"`)
* `failureFormat:` Format in which failure reports are requested (`rf=`, default: `'afrf'`) * `failureFormat:` Format in which failure reports are requested (`rf=`, default: `"afrf"`)
* `reportInterval:` Interval in which reports are requested (`ri=`) * `reportInterval:` Interval in which reports are requested (`ri=`)
* `ttl:` Input for `TTL` method (optional) * `ttl:` Input for `TTL` method (optional)

View File

@ -38,7 +38,7 @@ Note that the following are acceptable forms (symbols differ):
D("example.com","none" D("example.com","none"
LOC_BUILDER_STR({ LOC_BUILDER_STR({
label: "tasmania", label: "tasmania",
str: '42°S 147°E', str: "42°S 147°E",
alt: 3, alt: 3,
}) })
); );

View File

@ -38,7 +38,7 @@ Note that the following are acceptable forms (symbols differ):
D("example.com","none" D("example.com","none"
LOC_BUILDER_DMS_STR({ LOC_BUILDER_DMS_STR({
label: "sydney-opera-house", label: "sydney-opera-house",
str: '33°5131″S 151°1251″E', str: "33°5131″S 151°1251″E",
alt: 4, alt: 4,
ttl: "5m", ttl: "5m",
}) })

View File

@ -35,17 +35,17 @@ Accepts a string and tries all `LOC_BUILDER_DM*_STR({})` methods:
D("example.com","none" D("example.com","none"
, LOC_BUILDER_STR({ , LOC_BUILDER_STR({
label: "old-faithful", label: "old-faithful",
str: '44.46046°N 110.82815°W', str: "44.46046°N 110.82815°W",
alt: 2240, alt: 2240,
}) })
, LOC_BUILDER_STR({ , LOC_BUILDER_STR({
label: "ribblehead-viaduct", label: "ribblehead-viaduct",
str: '54.210436°N 2.370231°W', str: "54.210436°N 2.370231°W",
alt: 300, alt: 300,
}) })
, LOC_BUILDER_STR({ , LOC_BUILDER_STR({
label: "guinness-brewery", label: "guinness-brewery",
str: '53°2040″N 6°1720″W', str: "53°2040″N 6°1720″W",
alt: 300, alt: 300,
}) })
); );

View File

@ -33,7 +33,7 @@ It doesn't set up SPF or DMARC. See [`SPF_BUILDER`](/language-reference/record-m
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
M365_BUILDER({ M365_BUILDER({
initialDomain: 'example.onmicrosoft.com', initialDomain: "example.onmicrosoft.com",
}); });
``` ```
{% endcode %} {% endcode %}
@ -45,13 +45,13 @@ This sets up `MX` records, Autodiscover, and DKIM.
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
M365_BUILDER({ M365_BUILDER({
label: 'test', label: "test",
mx: false, mx: false,
autodiscover: false, autodiscover: false,
dkim: false, dkim: false,
mdm: true, mdm: true,
domainGUID: 'test-example-com', // Can be automatically derived in this case, if example.com is the context. domainGUID: "test-example-com", // Can be automatically derived in this case, if example.com is the context.
initialDomain: 'example.onmicrosoft.com', initialDomain: "example.onmicrosoft.com",
}); });
``` ```
{% endcode %} {% endcode %}
@ -60,7 +60,7 @@ This sets up Mobile Device Management only.
### Parameters ### Parameters
* `label` The label of the Microsoft 365 domain, useful if it is a subdomain (default: `'@'`) * `label` The label of the Microsoft 365 domain, useful if it is a subdomain (default: `"@"`)
* `mx` Set an `MX` record? (default: `true`) * `mx` Set an `MX` record? (default: `true`)
* `autodiscover` Set Autodiscover `CNAME` record? (default: `true`) * `autodiscover` Set Autodiscover `CNAME` record? (default: `true`)
* `dkim` Set DKIM `CNAME` records? (default: `true`) * `dkim` Set DKIM `CNAME` records? (default: `true`)

View File

@ -39,7 +39,7 @@ Here is an example of how SPF settings are normally done:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.tld", REG, DNS, ... D("example.tld", REG_MY_PROVIDER, DNS, ...
TXT("v=spf1 ip4:198.252.206.0/24 ip4:192.111.0.0/24 include:_spf.google.com include:mailgun.org include:spf-basic.fogcreek.com include:mail.zendesk.com include:servers.mcsv.net include:sendgrid.net include:450622.spf05.hubspotemail.net ~all") TXT("v=spf1 ip4:198.252.206.0/24 ip4:192.111.0.0/24 include:_spf.google.com include:mailgun.org include:spf-basic.fogcreek.com include:mail.zendesk.com include:servers.mcsv.net include:sendgrid.net include:450622.spf05.hubspotemail.net ~all")
) )
``` ```
@ -55,7 +55,7 @@ This has a few problems:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.tld", REG, DSP, ... D("example.tld", REG_MY_PROVIDER, DSP, ...
A("@", "10.2.2.2"), A("@", "10.2.2.2"),
MX("@", "example.tld."), MX("@", "example.tld."),
SPF_BUILDER({ SPF_BUILDER({
@ -98,7 +98,7 @@ When you want to specify SPF settings for a domain, use the
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D("example.tld", REG, DSP, ... D("example.tld", REG_MY_PROVIDER, DSP, ...
... ...
... ...
... ...
@ -305,11 +305,11 @@ var SPF_MYSETTINGS = SPF_BUILDER({
] ]
}); });
D("example.tld", REG, DSP, ... D("example.tld", REG_MY_PROVIDER, DSP, ...
SPF_MYSETTINGS SPF_MYSETTINGS
); );
D("example2.tld", REG, DSP, ... D("example2.tld", REG_MY_PROVIDER, DSP, ...
SPF_MYSETTINGS SPF_MYSETTINGS
); );
``` ```

View File

@ -26,12 +26,12 @@ The value can be:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
D('example.com', REGISTRAR, DnsProvider('R53'), D("example.com", REGISTRAR, DnsProvider("R53"),
DefaultTTL(2000), DefaultTTL(2000),
A('@','1.2.3.4'), // uses default A("@","1.2.3.4"), // uses default
A('foo', '2.3.4.5', TTL(500)), // overrides default A("foo", "2.3.4.5", TTL(500)), // overrides default
A('demo1', '3.4.5.11', TTL('5d')), // 5 days A("demo1", "3.4.5.11", TTL("5d")), // 5 days
A('demo2', '3.4.5.12', TTL('5w')), // 5 weeks A("demo2", "3.4.5.12", TTL("5w")), // 5 weeks
); );
``` ```
{% endcode %} {% endcode %}

View File

@ -88,11 +88,11 @@ The file looks like:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var REG_NONE = NewRegistrar('none'); var REG_NONE = NewRegistrar("none");
var DNS_BIND = NewDnsProvider('bind'); var DNS_BIND = NewDnsProvider("bind");
D('example.com', REG_NONE, DnsProvider(DNS_BIND), D("example.com", REG_NONE, DnsProvider(DNS_BIND),
A('@', '1.2.3.4') A("@", "1.2.3.4")
); );
``` ```
{% endcode %} {% endcode %}

View File

@ -1,10 +1,10 @@
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var REG_NONE = NewRegistrar('none'); var REG_NONE = NewRegistrar("none");
var DNS_BIND = NewDnsProvider('bind'); var DNS_BIND = NewDnsProvider("bind");
D('example.com', REG_NONE, DnsProvider(DNS_BIND), D("example.com", REG_NONE, DnsProvider(DNS_BIND),
A('@', '1.2.3.4') A("@", "1.2.3.4")
); );
``` ```
{% endcode %} {% endcode %}

View File

@ -1,10 +1,10 @@
{% code %} {% code %}
```javascript ```javascript
var REG_NONE = NewRegistrar('none'); var REG_NONE = NewRegistrar("none");
var DNS_BIND = NewDnsProvider('bind'); var DNS_BIND = NewDnsProvider("bind");
D('example.com', REG_NONE, DnsProvider(DNS_BIND), D("example.com", REG_NONE, DnsProvider(DNS_BIND),
A('@', '1.2.3.4') A("@", "1.2.3.4")
); );
``` ```
{% endcode %} {% endcode %}

View File

@ -252,7 +252,7 @@ See the [DNS-over-HTTPS Provider](providers/dnsoverhttps.md) documentation for m
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var REG_MONITOR = NewRegistrar('DNS-over-HTTPS'); var REG_MONITOR = NewRegistrar("DNS-over-HTTPS");
D("example1.com", REG_MONITOR, D("example1.com", REG_MONITOR,
NAMESERVER("ns1.example1.com."), NAMESERVER("ns1.example1.com."),

View File

@ -172,15 +172,15 @@ the following minimal configuration:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var REG = NewRegistrar('none'); var REG_NONE = NewRegistrar("none");
var DNS = NewDnsProvider('axfrddns', { var DNS = NewDnsProvider("axfrddns", {
default_ns: [ default_ns: [
"ns.example.com.", "ns.example.com.",
], ],
}); });
D('example.com', REG, DnsProvider(DNS), D("example.com", REG_NONE, DnsProvider(DNS),
A('ns', '127.0.0.1') A("ns", "127.0.0.1")
) )
``` ```
{% endcode %} {% endcode %}

View File

@ -61,10 +61,10 @@ An example configuration:
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var REG_NONE = NewRegistrar("name.com"); var REG_NAMECOM = NewRegistrar("name.com");
var DSP_GCLOUD = NewDnsProvider("gcloud"); var DSP_GCLOUD = NewDnsProvider("gcloud");
D("example.tld", REG_NONE, DnsProvider(DSP_GCLOUD), D("example.tld", REG_NAMECOM, DnsProvider(DSP_GCLOUD),
A("test", "1.2.3.4") A("test", "1.2.3.4")
); );
``` ```

View File

@ -90,16 +90,16 @@ each with different zone IDs specified using [`R53_ZONE()`](../functions/record/
var REG_NONE = NewRegistrar("none"); var REG_NONE = NewRegistrar("none");
var DSP_R53 = NewDnsProvider("r53_main"); var DSP_R53 = NewDnsProvider("r53_main");
D('testzone.net!private', REG_NONE, D("testzone.net!private", REG_NONE,
DnsProvider(DSP_R53), DnsProvider(DSP_R53),
R53_ZONE('Z111111111JCCCP1V7UW'), R53_ZONE("Z111111111JCCCP1V7UW"),
TXT('me', 'private testzone.net'), TXT("me", "private testzone.net"),
); );
D('testzone.net!public', REG_NONE, D("testzone.net!public", REG_NONE,
DnsProvider(DSP_R53), DnsProvider(DSP_R53),
R53_ZONE('Z222222222INNG98SHJQ2'), R53_ZONE("Z222222222INNG98SHJQ2"),
TXT('me', 'public testzone.net'), TXT("me", "public testzone.net"),
); );
``` ```
{% endcode %} {% endcode %}

View File

@ -80,11 +80,11 @@ Long example: (with filename)
{% code title="dnsconfig.js" %} {% code title="dnsconfig.js" %}
```javascript ```javascript
var REG_NONE = NewRegistrar('none'); var REG_NONE = NewRegistrar("none");
var DNS_BIND = NewDnsProvider('bind'); var DNS_BIND = NewDnsProvider("bind");
D('example.com', REG_NONE, DnsProvider(DNS_BIND), D("example.com", REG_NONE, DnsProvider(DNS_BIND),
A('@', '1.2.3.4') A("@", "1.2.3.4")
); );
``` ```
{% endcode %} {% endcode %}
@ -95,11 +95,11 @@ Long example: (without filename)
{% code %} {% code %}
```javascript ```javascript
var REG_NONE = NewRegistrar('none'); var REG_NONE = NewRegistrar("none");
var DNS_BIND = NewDnsProvider('bind'); var DNS_BIND = NewDnsProvider("bind");
D('example.com', REG_NONE, DnsProvider(DNS_BIND), D("example.com", REG_NONE, DnsProvider(DNS_BIND),
A('@', '1.2.3.4') A("@", "1.2.3.4")
); );
``` ```
{% endcode %} {% endcode %}