go-nsupdate/README.md

108 lines
4.4 KiB
Markdown
Raw Normal View History

[![Go build](https://github.com/SpComb/go-nsupdate/actions/workflows/build.yml/badge.svg)](https://github.com/SpComb/go-nsupdate/actions/workflows/build.yml)
2016-06-19 13:37:33 -05:00
# go-nsupdate
Update dynamic DNS records from netlink.
`go-nsupdate` reads interface addresses from netlink, updating on `ip link up/down` and `ip addr add/del` events.
The set of active interface IPv4/IPv6 addresses is used to send DNS `UPDATE` requests to the primary NS for a DNS zone.
2016-06-19 13:51:13 -05:00
The DNS update requests are retried in the background (XXX: currently blocks for 10s on each query attempt).
2016-06-19 13:37:33 -05:00
## Install
2016-06-19 14:06:25 -05:00
go get github.com/SpComb/go-nsupdate
2016-06-19 13:37:33 -05:00
## Usage
2016-06-19 13:56:06 -05:00
Usage:
go-nsupdate [OPTIONS] [Name]
Application Options:
-v, --verbose
--watch Watch for interface changes
-i, --interface=IFACE Use address from interface
2016-06-19 14:04:22 -05:00
--interface-family=ipv4|ipv6|all Limit to interface addreses of given family
--server=HOST[:PORT] Server for UPDATE query, default is discovered from zone SOA
--timeout=DURATION Timeout for sever queries (default: 10s)
--retry=DURATION Retry interval, increased for each retry attempt (default: 30s)
2016-06-19 13:56:06 -05:00
--tsig-name=FQDN
2016-06-19 14:04:22 -05:00
--tsig-secret=BASE-64 base64-encoded shared TSIG secret key [$TSIG_SECRET]
2016-06-19 13:56:06 -05:00
--tsig-algorithm=hmac-{md5,sha1,sha256,sha512}
2016-06-19 14:04:22 -05:00
--zone=FQDN Zone to update, default is derived from name
--ttl=DURATION TTL for updated records (default: 60s)
2016-06-19 13:56:06 -05:00
Help Options:
-h, --help Show this help message
Arguments:
Name: DNS Name to update
2016-06-19 14:04:22 -05:00
2016-06-19 13:56:06 -05:00
## Example
2022-06-24 03:54:18 -05:00
2016-06-19 13:37:33 -05:00
# Using a generated TSIG key:
# TSIG_SECRET=$(python -c 'import os; print os.urandom(32).encode("base64")')
2022-06-24 03:54:18 -05:00
2016-06-19 13:51:13 -05:00
TSIG_SECRET=... go-nsupdate --interface=vlan-wan --tsig-algorithm=hmac-sha256 yzzrt.dyn.qmsk.net --watch
2016/06/19 21:29:33 discover server=zovoweix.qmsk.net.
2016/06/19 21:29:33 using TSIG: yzzrt.dyn.qmsk.net (algo=hmac-sha256.)
2016/06/19 21:29:33 AddrSet iface=vlan-wan: up 2001:14ba:400:0:7:1449:a833:f11f
2016/06/19 21:29:33 update...
2016/06/19 21:29:33 update query:
;; opcode: UPDATE, status: NOERROR, id: 61616
;; flags:; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;dyn.qmsk.net. IN SOA
;; AUTHORITY SECTION:
yzzrt.dyn.qmsk.net. 0 ANY ANY
yzzrt.dyn.qmsk.net. 60 IN AAAA 2001:14ba:400:0:7:1449:a833:f11f
;; ADDITIONAL SECTION:
;; TSIG PSEUDOSECTION:
2022-06-24 03:54:18 -05:00
yzzrt.dyn.qmsk.net. 0 ANY TSIG hmac-sha256. 20160619182933 300 0 61616 0 0
2016-06-19 13:51:13 -05:00
2016/06/19 21:29:33 update answer:
;; opcode: UPDATE, status: NOERROR, id: 61616
;; flags: qr; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;dyn.qmsk.net. IN SOA
;; ADDITIONAL SECTION:
;; TSIG PSEUDOSECTION:
2022-06-24 03:54:18 -05:00
yzzrt.dyn.qmsk.net. 0 ANY TSIG hmac-sha256. 20160619182933 300 32 E083433B2893B2036B24549E3537C6E17B858019B9862DC2EB9EDFB959D03232 61616 0 0
2016-06-19 13:51:13 -05:00
2016/06/19 21:46:34 AddrSet iface=vlan-wan: up 213.243.178.191
2016/06/19 21:46:34 addrs update...
2016/06/19 21:46:34 update...
2016/06/19 21:46:34 update query:
;; opcode: UPDATE, status: NOERROR, id: 30973
;; flags:; QUERY: 1, ANSWER: 0, AUTHORITY: 3, ADDITIONAL: 1
;; QUESTION SECTION:
;dyn.qmsk.net. IN SOA
;; AUTHORITY SECTION:
yzzrt.dyn.qmsk.net. 0 ANY ANY
yzzrt.dyn.qmsk.net. 60 IN AAAA 2001:14ba:400:0:7:1449:a833:f11f
yzzrt.dyn.qmsk.net. 60 IN A 213.243.178.191
;; ADDITIONAL SECTION:
;; TSIG PSEUDOSECTION:
2022-06-24 03:54:18 -05:00
yzzrt.dyn.qmsk.net. 0 ANY TSIG hmac-sha256. 20160619184634 300 0 30973 0 0
2016-06-19 13:51:13 -05:00
2016/06/19 21:46:35 update answer:
;; opcode: UPDATE, status: NOERROR, id: 30973
;; flags: qr; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;dyn.qmsk.net. IN SOA
;; ADDITIONAL SECTION:
2016-06-19 13:37:33 -05:00
2016-06-19 13:51:13 -05:00
;; TSIG PSEUDOSECTION:
yzzrt.dyn.qmsk.net. 0 ANY TSIG hmac-sha256. 20160619184635 300 32 1F7F1EB8A3D5213EAAA163AE78388D48911495A0F3E2870688F3338160905EC9 30973 0