peach-dyndns-server/README.md

79 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

2021-12-18 23:35:17 +00:00
# peach-dyndns-server
2019-04-19 03:58:29 +00:00
2021-05-19 09:03:16 +00:00
a dynamic DNS server to host the names of guests with changing IP addresses
by providing an http API for updating bind9 configurations.
2019-04-19 03:58:29 +00:00
2021-12-18 23:35:17 +00:00
## Deployment
2019-04-19 03:58:29 +00:00
2021-12-18 23:35:17 +00:00
The bind9 server and peach-dyndns-server can be deployed with ansible vis setup_server.sh
2019-04-19 03:58:29 +00:00
2019-05-07 11:27:55 +00:00
## Development
2019-05-07 11:27:55 +00:00
2021-05-19 09:03:16 +00:00
```
sudo su peach-dyndns; ./target/release/main -vv
2019-05-07 11:27:55 +00:00
```
## Test
2021-12-18 23:35:17 +00:00
### ping
2021-12-18 22:58:48 +00:00
```
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "ping", "id":1 }' 127.0.0.1:3002
```
2021-12-18 23:35:17 +00:00
### register_domain
2021-05-19 09:03:16 +00:00
```
2021-12-18 22:58:48 +00:00
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "register_domain", "params" : {"domain": "mirage.dyn.peachcloud.org" }, "id":1 }' 127.0.0.1:3002
```
2021-12-18 23:35:17 +00:00
### is_domain_available
2021-12-18 22:58:48 +00:00
```
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "is_domain_available", "params" : {"domain": "mirage.dyn.peachcloud.org" }, "id":1 }' 127.0.0.1:3002
2021-05-19 09:03:16 +00:00
```
2021-12-18 15:34:55 +00:00
# register_domain
```
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "register_domain", "params" : {"domain": "mirage.dyn.peachcloud.org" }, "id":1 }' 127.0.0.1:3002
```
# is_domain_available
```
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "is_domain_available", "params" : {"domain": "mirage.dyn.peachcloud.org" }, "id":1 }' 127.0.0.1:3002
```
2022-01-11 21:35:54 +00:00
# test peach-bind9 is running,
2021-05-19 09:03:16 +00:00
```
2021-12-18 22:58:48 +00:00
# this returns version of bind running
dig -t txt -c chaos VERSION.BIND @IP_ADDRESS_OF_SERVER
# this returns records for blue.dyn.peachcloud.org
nslookup blue.dyn.peachcloud.org YOUR_SERVER_IP_ADDRESS
# this returns records for blue.dyn.peachcloud.org
2021-05-19 09:03:16 +00:00
nslookup blue.dyn.peachcloud.org ns.peachcloud.org
```
2021-12-18 22:58:48 +00:00
2022-01-11 21:35:54 +00:00
# test nsupdate is working
```
/usr/bin/nsupdate -k /var/lib/peachcloud/peach-dyndns/tsig.key -v <<EOF
server ns.peachcloud.org
zone bluemirage889.dyn.peachcloud.org
update delete bluemirage889.dyn.peachcloud.org
update add bluemirage889.dyn.peachcloud.org 30 A 174.76.52.101
send
EOF
```
```
cat <<EOF | /usr/bin/nsupdate -k /var/lib/peachcloud/peach-dyndns/tsig.key -v
server ns.peachcloud.org
zone bluemirage889.dyn.peachcloud.org
update delete bluemirage889.dyn.peachcloud.org
update add bluemirage889.dyn.peachcloud.org 30 A 174.76.52.101
send
EOF
2021-12-18 22:58:48 +00:00
```