summaryrefslogtreecommitdiff
path: root/dns.go
blob: 017ffced4cdbe653c03de49055310b779b06c03d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Various Linux/Unix'y things

// https://wiki.archlinux.org/title/Dynamic_DNS

package main

import 	(
//	"os"
//	"os/exec"
	"log"
	"net"
//	"git.wit.org/wit/gui"
//	"github.com/davecgh/go-spew/spew"
)

type IPtype struct {
	// IP		string
	IPv4		bool
	IPv6		bool
	LinkLocal	bool
}

type Host struct {
	Name		string
	domainname	string
	hostname	string
	fqdn		string
	ips		map[string]*IPtype
}

/*
	Check a bunch of things. If they don't work right, then things are not correctly configured
	They are things like:
		/etc/hosts
		hostname
		hostname -f
		domainname
*/
func (h *Host) verifyETC() bool {
	return true
}

func (h *Host) updateIPs(host string) {
    ips, err := net.LookupIP(host)
        if err != nil {
                log.Fatal(err)
        }
        for _, ip := range ips {
                log.Println(host, ip)
        }
}