dyndns cgi
1.0.0
RFC2136 NSUPDATE 용 CGI 래퍼.
AVM Fritz! Box, Ubiquiti Edgerouter 등과 호환됩니다.
이름 서버에 업데이트를 보내는 HMAC 키가 암호화됩니다 .
기조 연설과 암호는 스크립트의 사용자 이름과 비밀번호입니다.
기본 엔드 포인트.
Avm Fritz! Box에서 사용합니다.
| 매개 변수를 얻으십시오 | 설명 | 예 |
|---|---|---|
| 방법 | IP 주소를 쿼리 매개 변수 또는 요청 헤더에서 선택 해야하는 경우 컨트롤 | all : 매개 변수 및 요청 IP가 사용됩니다. request : 요청 IP가 사용됩니다. parameter : 쿼리 매개 변수가 사용됩니다. |
| 사용자 이름 | NSUPDATE에서 사용하는 HMAC 키의 이름 | exampleddns = /var/www/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 |
| 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에는 ansible 예가 있습니다.
apt install dnsutils nginx-full libnginx-mod-http-lua fcgiwrapSRC/ 폴더에있는 것처럼 Debian/ Ubuntu 시스템에 파일을 배치하십시오.
다른 Linux 배포를 실행하면 몇 가지 변경이 필요할 수 있습니다.
필요한 모든 구성은 src/etc/nginx/dyndns_cgi.conf에서 찾을 수 있습니다.
Nginx 가상 호스트에 포함되어야합니다.
가상 호스트 구성 예는 src/etc/nginx/sitees-enabled/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==";
};물론 이제 영역에 업데이트 정책을 추가 해야합니다.