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-29 08:12:05 +00:00
|
|
|
xip "local-ip.sh/xip"
|
2022-10-27 21:19:23 +00:00
|
|
|
)
|
|
|
|
|
2022-10-28 21:36:57 +00:00
|
|
|
const (
|
2022-10-29 08:12:05 +00:00
|
|
|
zone = "local-ip.sh."
|
|
|
|
nameservers = "ns1.local-ip.sh.,ns2.local-ip.sh."
|
2022-10-28 21:36:57 +00:00
|
|
|
)
|
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
|
|
|
}
|