local-ip.sh/main.go

22 lines
328 B
Go
Raw Normal View History

2022-10-27 21:19:23 +00:00
package main
import (
2022-10-28 21:36:57 +00:00
"flag"
2022-10-27 21:19:23 +00:00
"strings"
2022-10-28 21:36:57 +00:00
xip "local-ip.dev/xip"
2022-10-27 21:19:23 +00:00
)
2022-10-28 21:36:57 +00:00
const (
zone = "local-ip.dev."
2022-10-28 21:36:57 +00:00
nameservers = "ns.local-ip.dev."
)
2022-10-27 21:19:23 +00:00
func main() {
2022-10-28 21:36:57 +00:00
var port = flag.Int("port", 53, "port the DNS server should bind to")
flag.Parse()
2022-10-27 21:19:23 +00:00
2022-10-28 21:36:57 +00:00
n := xip.NewXip(zone, strings.Split(nameservers, ","), *port)
n.StartServer()
2022-10-27 21:19:23 +00:00
}