Compare commits
4 Commits
03b3375f8c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a7c784680 | |||
| fb818b86a2 | |||
| 8dc088ffde | |||
| 6ff47b2a29 |
@@ -4,10 +4,9 @@ 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
|
||||||
```
|
```
|
||||||
|
|
||||||
In your `Corefile`:
|
In your `Corefile`:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
5
setup.go
5
setup.go
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user