diff options
| author | Jeff Carr <[email protected]> | 2023-02-09 19:47:52 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-02-09 19:47:52 -0600 |
| commit | 3959b6c328fc335475f2e9df8aaabbc9a1ca7c43 (patch) | |
| tree | 4e657a9003bb94af8e2c89814f6cf6478dd1be9b /dns.go | |
| parent | d00a8f5cd32147370f8318b1e469558f44b6c81e (diff) | |
add a struct for the machinev0.0.1
'me' is probably not a great variable name
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'dns.go')
| -rw-r--r-- | dns.go | 51 |
1 files changed, 51 insertions, 0 deletions
@@ -0,0 +1,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) + } +} |
