dyndns cgi
1.0.0
RFC2136 NSUPDATE的CGI包装器。
与Avm Fritz!盒,Ubiquiti Edgerouter兼容。
将更新发送给名称服务器的HMAC键已加密。
Keyname和密码是脚本的用户名和密码。
默认端点。
由avm fritz!box使用。
| 获取参数 | 描述 | 例子 |
|---|---|---|
| 模式 | 控件是否应从查询参数或请求标题中选择IP地址 | all :使用参数和请求IP, request :请求IP, parameter :使用查询参数 |
| 用户名 | Nsupdate使用的HMAC键的名称 | exampleddns = /var/www/dyndns-cgi/keys/hmac-exampleddns.enc /dyndns-cgi/keys/hmac-exampleddns.enc |
| 密码 | 密码用于解密HMAC键 | |
| 领域 | 更新的域 | ddns.example.com |
| IP4 | IPv4地址要使用 | 127.0.0.1 |
| IP6 | IPv6地址要使用 | :: 1 |
| IP | IPv4或IPv6地址,定义ip4或ip6时忽略了参数 | 127.0.0.1 |
Dyndns版本1。
端点需要HTTP基本身份验证。
| 获取参数 | 描述 | 例子 |
|---|---|---|
| host_id | 更新的域 | ddns.example.com |
| 迈普 | IPv4或IPv6地址 | 127.0.0.1 |
Dyndns版本2。
由Ubiqiti Edgerouter使用。
端点需要HTTP基本身份验证。
| 获取参数 | 描述 | 例子 |
|---|---|---|
| 主机名 | 更新的域 | ddns.example.com |
| 迈普 | IPv4或IPv6地址 | 127.0.0.1 |
# original endpoint
curl " https://ns.example.com/cgi-bin/dyndns.cgi?username=exampleddns&password=eeh2phioyaa6ro1eiphuaRiuthee8EiJ&ip4=127.0.0.1&ip6=::1 " # dyndns1
# picked from ubiquiti edge router
curl -u exampleddns:eeh2phioyaa6ro1eiphuaRiuthee8EiJ " https://ns.example.com/nic/dyndns?action=edit&started=1&hostname=YES&host_id=ddns.example.com&myip=127.0.0.1 " # dyndns2
# picked from ubiquiti edge router
curl -u exampleddns:eeh2phioyaa6ro1eiphuaRiuthee8EiJ " https://ns.example.com/nic/update?system=dyndns&hostname=ddns.example.com&myip=127.0.0.1 " 在Ansible-example.yml中也有一个Ansible示例。
apt install dnsutils nginx-full libnginx-mod-http-lua fcgiwrap将文件放在您的Debian/ Ubuntu系统上,就像它们在SRC/文件夹中一样。
如果您运行另一个Linux发行版,则可能需要进行一些更改。
所有必需的配置都可以在src/etc/nginx/dyndns_cgi.conf中找到。
它必须包含在nginx虚拟主机中。
可以在src/etc/nginx/sites-enabled/xplox.conf中找到一个示例虚拟主机配置。
生成密码:
perry@localhost ~ $ pwgen 32 1
eeh2phioyaa6ro1eiphuaRiuthee8EiJ创建一个HMAC密钥:
perry@localhost ~ $ dnssec-keygen -a HMAC-SHA512 -b 512 -n HOST exampleddns
Kexampleddns.+165+26667
perry@localhost ~ $ cat Kexampleddns.+165+26667.private
Private-key-format: v1.3
Algorithm: 165 (HMAC_SHA512)
Key: 0L0iTAPeXmyWbu0wJMsWw52GqVfeL22aZE2xmhlNcrXNdCgF3262ifx2yIuJs+T1H8CWdV+79HClWOzwvnn/LA==
Bits: AAA=
Created: 20210925150939
Publish: 20210925150939
Activate: 20210925150939使用密码加密密钥:
root@localhost ~# echo -n "0L0iTAPeXmyWbu0wJMsWw52GqVfeL22aZE2xmhlNcrXNdCgF3262ifx2yIuJs+T1H8CWdV+79HClWOzwvnn/LA==" | openssl enc -aes-256-cbc -e -iter 1000 -a -salt > /var/www/dyndns-cgi/keys/hmac-exampleddns.enc
enter aes-256-cbc encryption password: eeh2phioyaa6ro1eiphuaRiuthee8EiJ
Verifying - enter aes-256-cbc encryption password: eeh2phioyaa6ro1eiphuaRiuthee8EiJ将密钥添加到bind9名称服务器:
key exampleddns {
algorithm hmac-sha512;
secret "0L0iTAPeXmyWbu0wJMsWw52GqVfeL22aZE2xmhlNcrXNdCgF3262ifx2yIuJs+T1H8CWdV+79HClWOzwvnn/LA==";
};当然,您现在还需要在区域中添加更新策略。