mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
DOCS: Clarify IPv6 variables are strings (#1775)
Co-authored-by: Jeffrey Cafferata <jeffrey@jcid.nl>
This commit is contained in:
@ -6,8 +6,6 @@ parameters:
|
|||||||
|
|
||||||
Converts an IPv4 address from string to an integer. This allows performing mathematical operations with the IP address.
|
Converts an IPv4 address from string to an integer. This allows performing mathematical operations with the IP address.
|
||||||
|
|
||||||
This does not accept IPv6 addresses. (PRs gladly accepted.)
|
|
||||||
|
|
||||||
{% capture example %}
|
{% capture example %}
|
||||||
```js
|
```js
|
||||||
var addrA = IP('1.2.3.4')
|
var addrA = IP('1.2.3.4')
|
||||||
@ -17,3 +15,18 @@ var addrB = addrA + 1
|
|||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
{% include example.html content=example %}
|
{% include example.html content=example %}
|
||||||
|
|
||||||
|
NOTE: `IP()` does not accept IPv6 addresses (PRs gladly accepted!). IPv6 addresses are simply strings:
|
||||||
|
|
||||||
|
{% capture example2 %}
|
||||||
|
```js
|
||||||
|
// IPv4 Var
|
||||||
|
var addrA1 = IP("1.2.3.4");
|
||||||
|
var addrA2 = "1.2.3.4";
|
||||||
|
|
||||||
|
// IPv6 Var
|
||||||
|
var addrAAAA = "0:0:0:0:0:0:0:0";
|
||||||
|
```
|
||||||
|
{% endcapture %}
|
||||||
|
|
||||||
|
{% include example.html content=example2 %}
|
||||||
|
@ -53,6 +53,12 @@ D('example.com', REG, DnsProvider('R53'),
|
|||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
NOTE: The `IP()` function doesn't currently support IPv6 (PRs welcome!). IPv6 addresses are strings.
|
||||||
|
|
||||||
|
```js
|
||||||
|
var addrAAAA = "0:0:0:0:0:0:0:0";
|
||||||
|
```
|
||||||
|
|
||||||
## Variables to swap active Data Center
|
## Variables to swap active Data Center
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
Reference in New Issue
Block a user