dyndns cgi
1.0.0
RFC2136 NSUPDATEのCGIラッパー。
AVM Fritz!Box、Ubiquiti Edgerouterなどに互換性があります。
名前サーバーに更新を送信するHMACキーは暗号化されています。
KeyNameとPassPhraseは、スクリプトのユーザー名とパスワードです。
デフォルトのエンドポイント。
AVM Fritz!Boxが使用します。
| パラメーターを取得します | 説明 | 例 |
|---|---|---|
| モード | IPアドレスをクエリパラメーターまたはリクエストヘッダーから選択する必要があるかどうかを制御します | all :パラメーターとリクエストIPが使用されます、 request :リクエストIPが使用されます、 parameter :クエリパラメーターが使用されます |
| ユーザー名 | nsupdateが使用するHMACキーの名前 | exampleddns = /var/www/dyndns-cgi/keys/hmac-exampleddns.enc |
| パスワード | HMACキーを復号化するために使用されるPassPhrase | |
| ドメイン | 更新するドメイン | ddns.example.com |
| IP4 | 使用するIPv4アドレス | 127.0.0.1 |
| IP6 | 使用するIPv6アドレス | :: 1 |
| IP | IP4またはIPv6アドレスを使用するアドレス、 ip4またはip6が定義されているときにパラメーターは無視されます | 127.0.0.1 |
dyndnsバージョン1。
エンドポイントには、HTTP基本認証が必要です。
| パラメーターを取得します | 説明 | 例 |
|---|---|---|
| host_id | 更新するドメイン | ddns.example.com |
| myip | 使用するIPv4またはIPv6アドレス | 127.0.0.1 |
dyndnsバージョン2。
Ubiqiti edgerouterが使用します。
エンドポイントには、HTTP基本認証が必要です。
| パラメーターを取得します | 説明 | 例 |
|---|---|---|
| ホスト名 | 更新するドメイン | ddns.example.com |
| myip | 使用する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にも存在する例があります。
apt install dnsutils nginx-full libnginx-mod-http-lua fcgiwrapdebian/ ubuntuシステムにファイルをSRC/フォルダーに配置します。
別のLinuxディストリビューションを実行する場合は、いくつかの変更を行う必要がある場合があります。
必要なすべての構成は、src/etc/nginx/dyndns_cgi.confにあります。
Nginx仮想ホストに含める必要があります。
例の仮想ホスト構成は、SRC/etc/nginx/sites-exebled/example.confにあります。
パスワードを生成します:
perry@localhost ~ $ pwgen 32 1
eeh2phioyaa6ro1eiphuaRiuthee8EiJHMACキーを作成します:
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: eeh2phioyaa6ro1eiphuaRiuthee8EiJbind9 nameserverにキーを追加します:
key exampleddns {
algorithm hmac-sha512;
secret "0L0iTAPeXmyWbu0wJMsWw52GqVfeL22aZE2xmhlNcrXNdCgF3262ifx2yIuJs+T1H8CWdV+79HClWOzwvnn/LA==";
};もちろん、ゾーンに更新ポリシーを追加する必要があります。