Add set EDNS0 with variable substitution (#937)

* Add set EDNS0 with variable substitution

* Change variable from $ to {}. Un-export constants

* Update README

* Change getRuleData() to ruleData(); Change to use string match from regexp
This commit is contained in:
Thong Huynh
2017-08-24 09:34:07 -07:00
committed by Miek Gieben
parent 5e9991556e
commit 3f05f7e6c0
7 changed files with 304 additions and 10 deletions

View File

@@ -15,7 +15,7 @@ func newNameRule(from, to string) (Rule, error) {
}
// Rewrite rewrites the the current request.
func (rule *nameRule) Rewrite(r *dns.Msg) Result {
func (rule *nameRule) Rewrite(w dns.ResponseWriter, r *dns.Msg) Result {
if rule.From == r.Question[0].Name {
r.Question[0].Name = rule.To
return RewriteDone