local-ip.sh/main.go

34 lines
604 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"
"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)
// not functional yet
/* go func() {
account := certs.LoadAccount()
log.Println(account.Registration.Body.Contact)
ddd := certs.NewCertsClient(n, account)
time.Sleep(5 * time.Second)
fmt.Println("requesting certs")
ddd.RequestCertificate()
}() */
2022-10-28 21:36:57 +00:00
n.StartServer()
2022-10-27 21:19:23 +00:00
}