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:
committed by
GitHub
parent
0b7dabacc8
commit
e97cf01744
@@ -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.`.
|
||||
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
|
||||
typos?
|
||||
|
||||
@@ -29,24 +29,24 @@ If the address does not include a "/" then `REV` assumes /32 for IPv4 addresses
|
||||
and /128 for IPv6 addresses.
|
||||
|
||||
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.
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
D(REV('1.2.3.0/24'), REGISTRAR, DnsProvider(BIND),
|
||||
PTR("1", 'foo.example.com.'),
|
||||
PTR("2", 'bar.example.com.'),
|
||||
PTR("3", 'baz.example.com.'),
|
||||
D(REV("1.2.3.0/24"), REGISTRAR, DnsProvider(BIND),
|
||||
PTR("1", "foo.example.com."),
|
||||
PTR("2", "bar.example.com."),
|
||||
PTR("3", "baz.example.com."),
|
||||
// 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),
|
||||
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
|
||||
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
|
||||
// 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::3", 'three.example.com.'), // 3.0.0...
|
||||
PTR("2001:db8:302::2", "two.example.com."), // 2.0.0...
|
||||
PTR("2001:db8:302::3", "three.example.com."), // 3.0.0...
|
||||
);
|
||||
```
|
||||
{% endcode %}
|
||||
|
Reference in New Issue
Block a user