Hi everyone,
Inspired by Paul sending the svn.apache.org configuration file I spent
a little time with pgeodns again today.
I was going to add MX record support; but in the process figured out
that really I should just get it fixed up so any record type will use
the geo/load-balancing features.
However - I'm slightly stuck on the configuration format. As a
reference the example.com example (from the test suite) is below.
As you can see I've been using a hash (associative array) for NS
records and my initial implementation for MX records did the same.
However, that won't work nicely with the load balancing stuff.
Questions:
1) Do we need 'how many records to use' configuration for each
record? (Or record type) -- or can we just use the same global (for
the domain) configuration that's currently used for A records? If
specified by record, at what level? One thought I had is that maybe
you need both a number and a 'satisfied' keyword to say "if you
matched at this country level, don't backfill up to $record_count".
For some record types returning more than one doesn't make sense (for
example CNAME's) - but maybe those can just be hardcoded to always
just return 1.
2) Do we need to be able to specify sets that'd be returned together,
or can 'other record types' always just work on an individual basis
(like A records do now)?
3) For NS records I made a way to specify the glue with the name; but
maybe that's superfluous -- it makes more sense to have static data
outside the geo zone when possible anyway. Thoughts?
If we can make them work just like A records, maybe specifying load
balancing/geo stuff for MX records would just be
"some-host" {
"mx": [ [ "10 mx1.example.com", 10 ], [ "10 mx2.example.com" ] ],
},
"some-host.europe" {
"mx": [ [ "10 mx1.eu.example.com", 10 ], [ "10
mx2.eu.example.com" ] ],
},
Configuration for the record (count etc) if it's needed could be
tacked on like
"mx": [ [ "10 mx1.example.com", 10 ], [ "10 mx2.example.com" ],
{ "max_hosts": 2 } ],
- ask
{ "serial": 1,
"ttl": 600,
"data" : {
"": { "ns": { "ns1.example.net": null, "ns2.example.net": null },
},
"foo": {
"a": [ [ "192.168.1.2", 10 ], [ "192.168.1.3", 10 ],
[ "192.168.1.4", 10 ] ]
},
"weight": {
"a": [ [ "192.168.1.2", 100 ], [ "192.168.1.3", 50 ],
[ "192.168.1.4", 25 ] ]
},
"alias": {
"a": [ [ "192.168.1.2", 10 ] ],
"ttl": 601,
},
"bar": {
"alias": "alias",
},
"www": {
"cname": "geo.bitnames.com"
},
"cname-long-ttl": {
"cname": "geo.bitnames.com",
"ttl": 86400
}
}
}