mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
CHANGE: Old SOA mbox format no longer a warning (#2191)
This commit is contained in:
@ -30,11 +30,13 @@ D("example.com", REG_THIRDPARTY, DnsProvider("DNS_BIND"),
|
|||||||
```
|
```
|
||||||
{% endcode %}
|
{% endcode %}
|
||||||
|
|
||||||
The email address should be specified like a normal RFC822/RFC5322 address (user@hostname.com). It will be converted into the required format (e.g. BIND format: `user.hostname.com`) by the provider as required. This has the benefit of being more human-readable plus DNSControl can properly handle escaping and other issues.
|
If you accidentally include an `@` in the email field DNSControl will quietly
|
||||||
|
change it to a `.`. This way you can specify a human-readable email address
|
||||||
|
when you are making it easier for spammers how to find you.
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
* Previously, the accepted format for the SOA mailbox field was `hostmaster.example.org`. This has been changed to `hostmaster@example.org`
|
|
||||||
* The serial number is managed automatically. It isn't even a field in `SOA()`.
|
* The serial number is managed automatically. It isn't even a field in `SOA()`.
|
||||||
* Most providers automatically generate SOA records. They will ignore any `SOA()` statements.
|
* Most providers automatically generate SOA records. They will ignore any `SOA()` statements.
|
||||||
|
* The mbox field should not be set to a real email address unless you love spam and hate your privacy.
|
||||||
|
|
||||||
There is more info about `SOA` in the documentation for the [BIND provider](../../providers/bind.md).
|
There is more info about `SOA` in the documentation for the [BIND provider](../../providers/bind.md).
|
||||||
|
@ -42,7 +42,7 @@ In this example we set the default SOA settings and NS records.
|
|||||||
var DSP_BIND = NewDnsProvider("bind", {
|
var DSP_BIND = NewDnsProvider("bind", {
|
||||||
"default_soa": {
|
"default_soa": {
|
||||||
"master": "ns1.example.tld.",
|
"master": "ns1.example.tld.",
|
||||||
"mbox": "sysadmin.example.tld.",
|
"mbox": "spamtrap.example.tld.",
|
||||||
"refresh": 3600,
|
"refresh": 3600,
|
||||||
"retry": 600,
|
"retry": 600,
|
||||||
"expire": 604800,
|
"expire": 604800,
|
||||||
@ -67,9 +67,7 @@ Because BIND is unique, BIND's SOA support is kind of a hack. It leaves the SOA
|
|||||||
1. The serial number: If something in the zone changes, the serial number is incremented (see below).
|
1. The serial number: If something in the zone changes, the serial number is incremented (see below).
|
||||||
2. Missing SOAs: If there is no SOA record in a zone (or the zone is being created for the first time), the SOA is created. The initial values are taken from the `default_soa` settings.
|
2. Missing SOAs: If there is no SOA record in a zone (or the zone is being created for the first time), the SOA is created. The initial values are taken from the `default_soa` settings.
|
||||||
|
|
||||||
The `default_soa` values are only used when creating an SOA for the first time. The values are not used to update an SOA. *Therefore, the only way to change an existing SOA is to edit the zone file.*
|
The `default_soa` values are only used when creating an SOA for the first time. The values are not used to update an SOA. Most people edit the SOA values by manually editing the zonefile or using the `SOA()` function.
|
||||||
|
|
||||||
There is an effort to make SOA records handled like A, CNAME, and other records. See https://github.com/StackExchange/dnscontrol/issues/1131
|
|
||||||
|
|
||||||
|
|
||||||
# FYI: SOA serial numbers
|
# FYI: SOA serial numbers
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package bind
|
package bind
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"strings"
|
||||||
|
|
||||||
"github.com/StackExchange/dnscontrol/v3/models"
|
"github.com/StackExchange/dnscontrol/v3/models"
|
||||||
"github.com/StackExchange/dnscontrol/v3/pkg/soautil"
|
"github.com/StackExchange/dnscontrol/v3/pkg/soautil"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func makeSoa(origin string, defSoa *SoaDefaults, existing, desired *models.RecordConfig) (*models.RecordConfig, uint32) {
|
func makeSoa(origin string, defSoa *SoaDefaults, existing, desired *models.RecordConfig) (*models.RecordConfig, uint32) {
|
||||||
@ -27,9 +27,6 @@ func makeSoa(origin string, defSoa *SoaDefaults, existing, desired *models.Recor
|
|||||||
soaMail := firstNonNull(desired.SoaMbox, existing.SoaMbox, defSoa.Mbox, "DEFAULT_NOT_SET.")
|
soaMail := firstNonNull(desired.SoaMbox, existing.SoaMbox, defSoa.Mbox, "DEFAULT_NOT_SET.")
|
||||||
if strings.Contains(soaMail, "@") {
|
if strings.Contains(soaMail, "@") {
|
||||||
soaMail = soautil.RFC5322MailToBind(soaMail)
|
soaMail = soautil.RFC5322MailToBind(soaMail)
|
||||||
} else {
|
|
||||||
fmt.Println("WARNING: SOA hostmaster address must be in the format hostmaster@example.com")
|
|
||||||
fmt.Println("WARNING: hostmaster.example.com is deprecated and will be dropped in a future version")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
soaRec.TTL = firstNonZero(desired.TTL, defSoa.TTL, existing.TTL, models.DefaultTTL)
|
soaRec.TTL = firstNonZero(desired.TTL, defSoa.TTL, existing.TTL, models.DefaultTTL)
|
||||||
|
Reference in New Issue
Block a user