diff --git a/documentation/functions/domain/SOA.md b/documentation/functions/domain/SOA.md index 31734d0e4..8a97400fa 100644 --- a/documentation/functions/domain/SOA.md +++ b/documentation/functions/domain/SOA.md @@ -30,11 +30,13 @@ D("example.com", REG_THIRDPARTY, DnsProvider("DNS_BIND"), ``` {% 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 -* 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()`. * 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). diff --git a/documentation/providers/bind.md b/documentation/providers/bind.md index 2cb6f5084..a2347001d 100644 --- a/documentation/providers/bind.md +++ b/documentation/providers/bind.md @@ -42,7 +42,7 @@ In this example we set the default SOA settings and NS records. var DSP_BIND = NewDnsProvider("bind", { "default_soa": { "master": "ns1.example.tld.", - "mbox": "sysadmin.example.tld.", + "mbox": "spamtrap.example.tld.", "refresh": 3600, "retry": 600, "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). 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.* - -There is an effort to make SOA records handled like A, CNAME, and other records. See https://github.com/StackExchange/dnscontrol/issues/1131 +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. # FYI: SOA serial numbers diff --git a/providers/bind/soa.go b/providers/bind/soa.go index 3c54be583..ecec7ada3 100644 --- a/providers/bind/soa.go +++ b/providers/bind/soa.go @@ -1,10 +1,10 @@ package bind import ( - "fmt" + "strings" + "github.com/StackExchange/dnscontrol/v3/models" "github.com/StackExchange/dnscontrol/v3/pkg/soautil" - "strings" ) 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.") if strings.Contains(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)