mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
AXFRDDNS Fix docs, fix handling of unsupported record types (#2335)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
@ -102,11 +102,16 @@ var DSP_AXFRDDNS = NewDnsProvider("axfrddns", {
|
|||||||
```
|
```
|
||||||
{% endcode %}
|
{% endcode %}
|
||||||
|
|
||||||
|
{% code title="creds.json" %}
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
nameservers = "ns1.example.tld,ns2.example.tld,ns3.example.tld,ns4.example.tld"
|
"axfrddns": {
|
||||||
|
"TYPE": "AXFRDDNS",
|
||||||
|
"nameservers": "ns1.example.tld.,ns2.example.tld.,ns3.example.tld.,ns4.example.tld."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
### Primary master
|
### Primary master
|
||||||
|
|
||||||
@ -119,11 +124,16 @@ of the zone. In that case, the IP or the name of the primary server
|
|||||||
must be provided in `creds.json`. With this option, a non-standard
|
must be provided in `creds.json`. With this option, a non-standard
|
||||||
port might be used.
|
port might be used.
|
||||||
|
|
||||||
|
{% code title="creds.json" %}
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
master = "10.20.30.40:5353"
|
"axfrddns": {
|
||||||
|
"TYPE": "AXFRDDNS",
|
||||||
|
"master": "10.20.30.40:5353"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
When no nameserver appears in the zone, and no default nameservers nor
|
When no nameserver appears in the zone, and no default nameservers nor
|
||||||
custom master are configured, the AXFR+DDNS provider will fail with
|
custom master are configured, the AXFR+DDNS provider will fail with
|
||||||
@ -144,6 +154,37 @@ The changes will then be split in two DDNS updates, applied
|
|||||||
successively by the server. This will allow Knot to successfully apply
|
successively by the server. This will allow Knot to successfully apply
|
||||||
the changes, but you will loose the atomic-update property.
|
the changes, but you will loose the atomic-update property.
|
||||||
|
|
||||||
|
### Example: local testing
|
||||||
|
|
||||||
|
When testing `dnscontrol` against a local nameserver, you might use
|
||||||
|
the following minimal configuration:
|
||||||
|
|
||||||
|
{% code title="creds.json" %}
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"axfrddns": {
|
||||||
|
"TYPE": "AXFRDDNS",
|
||||||
|
"master": "127.0.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|
{% code title="dnsconfig.js" %}
|
||||||
|
```javascript
|
||||||
|
var REG = NewRegistrar('none');
|
||||||
|
var DNS = NewDnsProvider('axfrddns', {
|
||||||
|
default_ns: [
|
||||||
|
"ns.example.com.",
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
D('example.com', REG, DnsProvider(DNS),
|
||||||
|
A('ns', '127.0.0.1')
|
||||||
|
)
|
||||||
|
```
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|
|
||||||
## Server configuration examples
|
## Server configuration examples
|
||||||
|
|
||||||
|
@ -281,16 +281,19 @@ func (c *axfrddnsProvider) GetZoneRecords(domain string, meta map[string]string)
|
|||||||
var foundDNSSecRecords *models.RecordConfig
|
var foundDNSSecRecords *models.RecordConfig
|
||||||
foundRecords := models.Records{}
|
foundRecords := models.Records{}
|
||||||
for _, rr := range rawRecords {
|
for _, rr := range rawRecords {
|
||||||
switch rr.(type) {
|
switch rr.Header().Rrtype {
|
||||||
case *dns.RRSIG,
|
case dns.TypeRRSIG,
|
||||||
*dns.DNSKEY,
|
dns.TypeDNSKEY,
|
||||||
*dns.CDNSKEY,
|
dns.TypeCDNSKEY,
|
||||||
*dns.CDS,
|
dns.TypeCDS,
|
||||||
*dns.NSEC,
|
dns.TypeNSEC,
|
||||||
*dns.NSEC3,
|
dns.TypeNSEC3,
|
||||||
*dns.NSEC3PARAM:
|
dns.TypeNSEC3PARAM,
|
||||||
|
65534:
|
||||||
// Ignoring DNSSec RRs, but replacing it with a single
|
// Ignoring DNSSec RRs, but replacing it with a single
|
||||||
// "TXT" placeholder
|
// "TXT" placeholder
|
||||||
|
// Also ignoring spurious TYPE65534, see:
|
||||||
|
// https://bind9-users.isc.narkive.com/zX29ay0j/rndc-signing-list-not-working#post2
|
||||||
if foundDNSSecRecords == nil {
|
if foundDNSSecRecords == nil {
|
||||||
foundDNSSecRecords = new(models.RecordConfig)
|
foundDNSSecRecords = new(models.RecordConfig)
|
||||||
foundDNSSecRecords.Type = "TXT"
|
foundDNSSecRecords.Type = "TXT"
|
||||||
|
Reference in New Issue
Block a user