mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
DOCS: Improve consistency in code examples in language reference (#2439)
Co-authored-by: Tom Limoncelli <tal@whatexit.org>
This commit is contained in:
committed by
GitHub
parent
0bf24d0282
commit
7977a7b81c
@ -36,7 +36,7 @@ This example redirects the bare (aka apex, or naked) domain to www:
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
|
||||
CF_REDIRECT("mydomain.com/*", "https://www.mydomain.com/$1"),
|
||||
CF_REDIRECT("example.com/*", "https://www.example.com/$1"),
|
||||
);
|
||||
```
|
||||
{% endcode %}
|
||||
|
@ -29,7 +29,7 @@ managed by DNSControl and those that aren't.
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
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.example.com/*", "https://otherplace.yourdomain.com/$1"),
|
||||
);
|
||||
```
|
||||
{% endcode %}
|
||||
|
@ -13,8 +13,8 @@ See [`IGNORE()`](../domain/IGNORE.md) for more information.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
D("example.com", ...
|
||||
```javascript
|
||||
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
|
||||
DISABLE_IGNORE_SAFETY_CHECK,
|
||||
...
|
||||
TXT("myhost", "mytext"),
|
||||
|
@ -70,7 +70,7 @@ General examples:
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D("example.com", ...
|
||||
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
|
||||
IGNORE("foo"), // matches any records on foo.example.com
|
||||
IGNORE("baz", "A"), // matches any A records on label baz.example.com
|
||||
IGNORE("*", "MX", "*"), // matches all MX records
|
||||
@ -86,7 +86,7 @@ Ignore Let's Encrypt (ACME) validation records:
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D("example.com", ...
|
||||
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
|
||||
IGNORE("_acme-challenge", "TXT"),
|
||||
IGNORE("_acme-challenge.**", "TXT"),
|
||||
END);
|
||||
@ -97,7 +97,7 @@ Ignore DNS records typically inserted by Microsoft ActiveDirectory:
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D("example.com", ...
|
||||
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
|
||||
IGNORE("_gc", "SRV"), // General Catalog
|
||||
IGNORE("_gc.**", "SRV"), // General Catalog
|
||||
IGNORE("_kerberos", "SRV"), // Kerb5 server
|
||||
@ -128,7 +128,7 @@ using DNSControl notation for the records. Pretend some other system inserted th
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D("example.com", ...
|
||||
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
|
||||
A("@", "151.101.1.69"),
|
||||
A("www", "151.101.1.69"),
|
||||
A("foo", "1.1.1.1"),
|
||||
@ -261,7 +261,7 @@ This will generate an error:
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D("example.com", ...
|
||||
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
|
||||
...
|
||||
TXT("myhost", "mytext"),
|
||||
IGNORE("myhost", "*", "*"), // Error! Ignoring an item we inserted
|
||||
@ -274,7 +274,7 @@ to the `D()`.
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D("example.com", ...
|
||||
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
|
||||
DISABLE_IGNORE_SAFETY_CHECK,
|
||||
...
|
||||
TXT("myhost", "mytext"),
|
||||
|
@ -102,7 +102,7 @@ The coordinate format for `LOC()` is:
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D("example.com","none"
|
||||
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
|
||||
// LOC "subdomain", d1, m1, s1, "[NnSs]", d2, m2, s2, "[EeWw]", alt, siz, hp, vp)
|
||||
//42 21 54 N 71 06 18 W -24m 30m
|
||||
, LOC("@", 42, 21, 54, "N", 71, 6, 18, "W", -24, 30, 0, 0)
|
||||
|
@ -83,7 +83,7 @@ It looks like this:
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
var REG_THIRDPARTY = NewRegistrar("ThirdParty");
|
||||
D("mydomain.com", REG_THIRDPARTY,
|
||||
D("example.com", REG_THIRDPARTY,
|
||||
...
|
||||
)
|
||||
```
|
||||
|
@ -25,7 +25,7 @@ parameter_types:
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D("example.com", REG_MY_PROVIDER, DnsProvider("DNS_BIND"),
|
||||
SOA("@", "ns3.example.org.", "hostmaster@example.org", 3600, 600, 604800, 1440),
|
||||
SOA("@", "ns3.example.com.", "hostmaster@example.com", 3600, 600, 604800, 1440),
|
||||
);
|
||||
```
|
||||
{% endcode %}
|
||||
|
@ -25,8 +25,8 @@ Priority, weight, and port are ints.
|
||||
D("example.com", REG_MY_PROVIDER, DnsProvider("GCLOUD"),
|
||||
// Create SRV records for a a SIP service:
|
||||
// pr w port, target
|
||||
SRV("_sip._tcp", 10, 60, 5060, "bigbox.example.tld."),
|
||||
SRV("_sip._tcp", 10, 20, 5060, "smallbox1.example.tld."),
|
||||
SRV("_sip._tcp", 10, 60, 5060, "bigbox.example.com."),
|
||||
SRV("_sip._tcp", 10, 20, 5060, "smallbox1.example.com."),
|
||||
);
|
||||
```
|
||||
{% endcode %}
|
||||
|
Reference in New Issue
Block a user