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

DOCS: Mostly styling and links (#2178)

Co-authored-by: Tom Limoncelli <tal@whatexit.org>
This commit is contained in:
Paul Dee
2023-03-15 23:43:57 +01:00
committed by GitHub
parent 81054e72c5
commit 731181ffa1
24 changed files with 186 additions and 110 deletions

View File

@@ -8,6 +8,7 @@ The document shows examples of many common and uncommon configurations.
All the examples use the variables. Substitute your own.
{% code title="dnsconfig.js" %}
```javascript
// ========== Registrars:
@@ -27,6 +28,8 @@ var DNS_GOOGLE = NewDnsProvider("gcp_main");
var DNS_CLOUDFLARE = NewDnsProvider("cloudflare_main");
var DNS_BIND = NewDnsProvider("bind");
```
{% endcode %}
# Typical Delegations
@@ -38,12 +41,15 @@ Use the same provider as a registrar and DNS service.
Why?
Simplicity.
{% code title="dnsconfig.js" %}
```javascript
D("example1.com", REG_NAMECOM,
DnsProvider(DNS_NAMECOM),
A("@", "10.2.3.4")
);
```
{% endcode %}
## Different provider for REG and DNS
@@ -54,13 +60,15 @@ Why?
Some registrars do not provide DNS server, or their service is sub-standard and
you want to use a high-performance DNS server.
{% code title="dnsconfig.js" %}
```javascript
D("example1.com", REG_NAMECOM,
DnsProvider(DNS_AWS),
A("@", "10.2.3.4")
);
```
{% endcode %}
## Registrar is elsewhere
@@ -73,12 +81,15 @@ You don't have access to the registrar, or the registrar is not
supported by DNSControl. However you do have API access for
updating the zone's records (most likely at a different provider).
{% code title="dnsconfig.js" %}
```javascript
D("example1.com", REG_THIRDPARTY,
DnsProvider(DNS_NAMECOM),
A("@", "10.2.3.4")
);
```
{% endcode %}
## Zone is elsewhere
@@ -90,6 +101,7 @@ We are delegating the domain to someone else. In this example we're
pointing the domain to the nsone.net DNS service, which someone else is
controlling.
{% code title="dnsconfig.js" %}
```javascript
D("example1.com", REG_NAMECOM,
NAMESERVER("dns1.p03.nsone.net."),
@@ -98,6 +110,8 @@ D("example1.com", REG_NAMECOM,
NAMESERVER("dns4.p03.nsone.net."),
);
```
{% endcode %}
## Override nameservers
@@ -110,6 +124,7 @@ nameservers are, or the API is returning invalid data, or if the API returns no
information. Sometimes APIs return no (useful) information when the domain
is new; this is a good temporary work-around until the API starts working.
{% code title="dnsconfig.js" %}
```javascript
D("example1.com", REG_NAMECOM,
DnsProvider(DNS_CLOUDFLARE, 0), // Set the DNS provider but ignore the nameservers it suggests (0 == take none of the names it reports)
@@ -118,6 +133,8 @@ D("example1.com", REG_NAMECOM,
A("@", "10.2.3.4")
);
```
{% endcode %}
## Add nameservers
@@ -127,6 +144,7 @@ Use the default nameservers from the registrar but add additional ones.
Why?
Usually only to correct a bug or misconfiguration elsewhere.
{% code title="dnsconfig.js" %}
```javascript
D("example1.com", REG_NAMECOM,
DnsProvider(DNS_NAMECOM),
@@ -134,6 +152,8 @@ D("example1.com", REG_NAMECOM,
A("@", "10.2.3.4")
);
```
{% endcode %}
## Shadow nameservers
@@ -147,6 +167,7 @@ There are many reasons to do this:
* You want your DNS records stored somewhere else in case you have to switch over in an emergency.
* You are sending the zone to a local caching DNS server.
{% code title="dnsconfig.js" %}
```javascript
D("example1.com", REG_NAMECOM,
DnsProvider(DNS_NAMECOM), // Our real DNS server
@@ -155,6 +176,8 @@ D("example1.com", REG_NAMECOM,
A("@", "10.2.3.4")
);
```
{% endcode %}
## Dual DNS Providers
@@ -175,6 +198,7 @@ More info: https://www.dns-oarc.net/files/workshop-201203/OARC-workshop-London-2
**NOTE**: This is overkill unless you have millions of users and strict up-time requirements.
{% endhint %}
{% code title="dnsconfig.js" %}
```javascript
D("example1.com", REG_NAMECOM,
DnsProvider(DNS_AWS, 2), // Take 2 nameservers from AWS
@@ -182,6 +206,8 @@ D("example1.com", REG_NAMECOM,
A("@", "10.2.3.4")
);
```
{% endcode %}
# Other uses
@@ -201,6 +227,7 @@ this is the output of DNSControl, not the input.
**NOTE**: This won't work if you use pseudo rtypes that BIND doesn't support.
{% endhint %}
{% code title="dnsconfig.js" %}
```javascript
D("example1.com", REG_NAMECOM,
DnsProvider(DNS_NAMECOM),
@@ -208,6 +235,8 @@ D("example1.com", REG_NAMECOM,
A("@", "10.2.3.4")
);
```
{% endcode %}
## Monitor delegation
@@ -221,6 +250,7 @@ Sometimes you just want to know if something changes!
See the [DNS-over-HTTPS Provider](providers/dnsoverhttps.md) documentation for more info.
{% code title="dnsconfig.js" %}
```javascript
var REG_MONITOR = NewRegistrar('DNS-over-HTTPS');
@@ -229,6 +259,8 @@ D("example1.com", REG_MONITOR,
NAMESERVER("ns2.example1.com."),
);
```
{% endcode %}
{% hint style="info" %}
**NOTE**: This checks the NS records via a DNS query. It does not check the
@@ -244,6 +276,7 @@ DNSControl has some built-in macros that you might find useful.
Easily delegate a domain to a specific list of nameservers.
{% code title="dnsconfig.js" %}
```javascript
DOMAIN_ELSEWHERE("example1.com", REG_NAMECOM, [
"dns1.example.net.",
@@ -251,18 +284,23 @@ DOMAIN_ELSEWHERE("example1.com", REG_NAMECOM, [
"dns3.example.net.",
]);
```
{% endcode %}
## `DOMAIN_ELSEWHERE_AUTO`
Easily delegate a domain to a nameservers via an API query.
Easily delegate a domain to a nameserver via an API query.
This is similar to `DOMAIN_ELSEWHERE` but the list
of nameservers is queried from the API of a single DNS provider.
{% code title="dnsconfig.js" %}
```javascript
DOMAIN_ELSEWHERE_AUTO("example1.com", REG_NAMECOM, DNS_AWS);
DOMAIN_ELSEWHERE_AUTO("example2.com", REG_NAMECOM, DNS_GOOGLE);
```
{% endcode %}
# Limits