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==";
};當然,您現在還需要在區域中添加更新策略。