Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Generate correct SOA and NS records
Browse files Browse the repository at this point in the history
The SOAMname and SOARname were switched around in a few places which
caused SOA and NS records to be wrong.

Fixes #295
  • Loading branch information
Tomás Senart committed Oct 2, 2015
1 parent d9ffd03 commit ba19f2d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions config.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"resolvers": ["8.8.8.8"],
"timeout": 5,
"listener": "0.0.0.0",
"SOAMname": "root.ns1.mesos",
"SOARname": "ns1.mesos",
"SOAMname": "ns1.mesos",
"SOARname": "root.ns1.mesos",
"SOARefresh": 60,
"SOARetry": 600,
"SOAExpire": 86400,
Expand Down
8 changes: 5 additions & 3 deletions docs/docs/configuration-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ The configuration file should include the following fields:
"httpport": 8123,
"externalon": true,
"listener": "10.101.160.16",
"SOAMname": "root.ns1.mesos",
"SOARname": "ns1.mesos",
"SOAMname": "ns1.mesos",
"SOARname": "root.ns1.mesos",
"SOARefresh": 60,
"SOARetry": 600,
"SOAExpire": 86400,
Expand Down Expand Up @@ -61,7 +61,9 @@ It is sufficient to specify just one of the `zk` or `masters` field. If both are

`externalon` is a boolean field that controls whether Mesos-DNS serves requests outside of the Mesos domain. The default value is `true`.

`SOAMname` is the MNAME field in the SOA record for the Mesos domain. The format is `mailbox.domain`, using a `.` instead of `@`. For example, if the email address is `[email protected]`, the `email` field should be `root.mesos-dns.mesos`. For details, see the [RFC-1035](http://tools.ietf.org/html/rfc1035#page-18). The default value is `root.ns1.mesos`.
`SOAMname` specifies the domain name of the name server that was the original or primary source of data for the configured domain. The default value is `ns1.mesos`.

`SOARname` specifies the mailbox of the person responsible for the configured domain. The format is `mailbox.domain`, using a `.` instead of `@`. i.e. `[email protected]` becomes `root.ns1.mesos`. For details, see the [RFC-1035](http://tools.ietf.org/html/rfc1035#page-18). The default value is `root.ns1.mesos`.

`SOARefresh` is the REFRESH field in the SOA record for the Mesos domain. For details, see the [RFC-1035](http://tools.ietf.org/html/rfc1035#page-18). The default value is `60`.

Expand Down
4 changes: 2 additions & 2 deletions resolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ func (res *Resolver) formatSOA(dom string) (*dns.SOA, error) {
Class: dns.ClassINET,
Ttl: ttl,
},
Ns: res.config.SOARname,
Mbox: res.config.SOAMname,
Ns: res.config.SOAMname,
Mbox: res.config.SOARname,
Serial: res.config.SOASerial,
Refresh: res.config.SOARefresh,
Retry: res.config.SOARetry,
Expand Down
8 changes: 4 additions & 4 deletions resolver/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func TestHandlers(t *testing.T) {
Header(true, dns.RcodeSuccess),
NSs(
SOA(RRHeader("non-existing.mesos.", dns.TypeSOA, 60),
"root.ns1.mesos", "ns1.mesos", 60))),
"ns1.mesos", "root.ns1.mesos", 60))),
},
{
res.HandleMesos,
Expand All @@ -177,7 +177,7 @@ func TestHandlers(t *testing.T) {
Header(true, dns.RcodeNameError),
NSs(
SOA(RRHeader("missing.mesos.", dns.TypeSOA, 60),
"root.ns1.mesos", "ns1.mesos", 60))),
"ns1.mesos", "root.ns1.mesos", 60))),
},
{
res.HandleMesos,
Expand All @@ -186,7 +186,7 @@ func TestHandlers(t *testing.T) {
Header(true, dns.RcodeSuccess),
NSs(
SOA(RRHeader("chronos.marathon.mesos.", dns.TypeSOA, 60),
"root.ns1.mesos", "ns1.mesos", 60))),
"ns1.mesos", "root.ns1.mesos", 60))),
},
{
res.HandleMesos,
Expand All @@ -195,7 +195,7 @@ func TestHandlers(t *testing.T) {
Header(true, dns.RcodeNameError),
NSs(
SOA(RRHeader("missing.mesos.", dns.TypeSOA, 60),
"root.ns1.mesos", "ns1.mesos", 60))),
"ns1.mesos", "root.ns1.mesos", 60))),
},
{
res.HandleNonMesos,
Expand Down

0 comments on commit ba19f2d

Please sign in to comment.