Compare commits

...

4 Commits

Author SHA1 Message Date
5a7c784680 moved log to ResponseWrapper 2022-04-03 22:37:22 +02:00
fb818b86a2 removed debug line 2022-04-03 16:15:08 +02:00
8dc088ffde improved README 2022-04-03 16:14:48 +02:00
6ff47b2a29 fixed rules parsing & debug 2022-04-03 01:44:37 +02:00
3 changed files with 5 additions and 8 deletions

View File

@@ -4,8 +4,7 @@ I made this to override the public IP address of my server with its VPN IP addre
There is probably a better way to do this, but I couldn't find it. There is probably a better way to do this, but I couldn't find it.
# Usage # Usage
Add this to your `plugin.cfg` beetween `minimal` and `template` :
Add this to your `plugin.cfg`:
``` ```
override:git.kapelle.org/niklas/coredns-override override:git.kapelle.org/niklas/coredns-override
``` ```

View File

@@ -3,9 +3,12 @@ package override
import ( import (
"net" "net"
clog "github.com/coredns/coredns/plugin/pkg/log"
"github.com/miekg/dns" "github.com/miekg/dns"
) )
var log = clog.NewWithPlugin("override")
type Rule struct { type Rule struct {
Search net.IP Search net.IP
Override net.IP Override net.IP

View File

@@ -6,18 +6,13 @@ import (
"github.com/coredns/caddy" "github.com/coredns/caddy"
"github.com/coredns/coredns/core/dnsserver" "github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin" "github.com/coredns/coredns/plugin"
clog "github.com/coredns/coredns/plugin/pkg/log"
) )
var log = clog.NewWithPlugin("overide")
func init() { func init() {
plugin.Register("override", setup) plugin.Register("override", setup)
} }
func setup(c *caddy.Controller) error { func setup(c *caddy.Controller) error {
c.Next()
rules, err := parseRules(c) rules, err := parseRules(c)
if err != nil { if err != nil {