OPNsense Forum

International Forums => German - Deutsch => Topic started by: soernt.poppe on February 11, 2017, 01:42:55 pm

Title: DynDNS - Custom Type
Post by: soernt.poppe on February 11, 2017, 01:42:55 pm
Hallo zusammen,

Ich verwalte meine Domainen mit der dem Anbieter "Deutsche Domainbank". Die bieten auch einen DynDNS - Dienst an.

Die Dokumentation der Deutschen Domainbank hinsichtlich DynDNS sagt folgendes:

Authentisierung per URL

Für Webbrowser oder andere Programme (fetch, curl, lwp-request) die die Authentisierung per URL Übertragen können.

http://username:password@direkt-domains.de/nic/update?hostname=yourhostname&myip=ipaddress

Raw HTTP GET Anfrage

HTTP requests sollten wie folgt aussehen. Bitte beachten Sie das die hier abgebildeten Headers das minimum darstellen und durchaus ausführlicher sein können. Alle Anfragen sollten von einer leeren Zeile gefolgt sein.
Der Teil base-64-authorization sollte Base 64 encodiert durchgeführt werden "username:password".

Code: [Select]
GET /nic/update?hostname=yourhostname&myip=ipaddress HTTP/1.0
Host: direkt-domains.de
Authorization: Basic base-64-authorization
User-Agent: Company - Device - Version Number

Ich habe jetzt die URL mit Benutzernamen, Passwort Hostnamen und IP wie folgt zusammengesetzt:

Code: [Select]
https://Fred:PasswortVonFred@direkt-domains.de/nic/update?hostname=MeineDomain&myip=%IP%
%IP% wird von opnSense ersetzt.

und in das Feld Update URL eingetragen.

Das scheint zu funktionieren auch wenn Benutzernamen und Passwort nicht BASE64 codiert sind.

ich habe die Abfrage mal per FireFox abgeschickt und ich bekomme folgendes im Browser angezeigt:

Code: [Select]
good 91.96.39.230
Bei wiederholten mal bekomme ich:

Code: [Select]
nochg 91.96.39.230
Das ist laut den Return Codes des DynDNS Protokolls (https://help.dyn.com/remote-access-api/return-codes/ (https://help.dyn.com/remote-access-api/return-codes/)) alles gut.

In der Maske von opnSense gibt es noch das Feld "Result Match". Was sollte ich hier eintragen?
Sowas wie:
Code: [Select]
good &IP%
was passiert dann mit:
Code: [Select]
nochg &IP%?

Ich habe die Option "Verbose logging" eingeschaltet. Im Bereich "Services->DNS Tools->Log File" hätte ich jetzt klare Erfolgs- oder Fehlermeldung erwartet. Da stehen zwar Einträge, mir ist aber nicht klar ob die Anfrage nun gut oder nicht gut gegangen sind.

In der Übersicht der DynDNS Einträge steht mein Eintrag mit grüner "Cached IP".

Code: [Select]
Feb 11 13:34:54 dnsmasq[13538]: read /var/etc/dnsmasq-hosts - 27 addresses
Feb 11 13:34:54 dnsmasq[13538]: read /etc/hosts - 2 addresses
Feb 11 13:34:54 dnsmasq[13538]: read /var/etc/dnsmasq-hosts - 24 addresses
Feb 11 13:34:54 dnsmasq[13538]: read /etc/hosts - 2 addresses
Feb 11 13:34:54 dnsmasq[13538]: using nameserver 80.190.187.210#53
Feb 11 13:34:54 dnsmasq[13538]: using nameserver 8.8.8.8#53
Feb 11 13:34:54 dnsmasq[13538]: using nameserver 2.2.2.2#53
Feb 11 13:34:54 dnsmasq[13538]: using nameserver 212.6.64.162#53
Feb 11 13:34:54 dnsmasq[13538]: ignoring nameserver 127.0.0.1 - local interface
Feb 11 13:34:54 dnsmasq[13538]: reading /etc/resolv.conf
Feb 11 13:34:54 dnsmasq[13538]: DNS service limited to local subnets
Feb 11 13:34:54 dnsmasq[13538]: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth DNSSEC loop-detect no-inotify
Feb 11 13:34:54 dnsmasq[13538]: started, version 2.76 cachesize 10000
Feb 11 13:34:54 dnsmasq[50997]: exiting on receipt of SIGTERM
Feb 11 13:10:01 dnsmasq[50997]: read /var/etc/dnsmasq-hosts - 27 addresses
Feb 11 13:10:01 dnsmasq[50997]: read /etc/hosts - 2 addresses
Feb 11 13:08:36 dnsmasq[50997]: failed to send packet: Host is down
Feb 11 13:08:36 dnsmasq[50997]: failed to send packet: Host is down
Feb 11 13:08:36 dnsmasq[50997]: failed to send packet: Host is down
Feb 11 13:08:27 dnsmasq[50997]: failed to send packet: Host is down
Feb 11 12:49:11 dnsmasq[50997]: read /var/etc/dnsmasq-hosts - 28 addresses
Feb 11 12:49:11 dnsmasq[50997]: read /etc/hosts - 2 addresses
Feb 11 12:49:11 dnsmasq[50997]: read /var/etc/dnsmasq-hosts - 24 addresses
Feb 11 12:49:11 dnsmasq[50997]: read /etc/hosts - 2 addresses
Feb 11 12:49:11 dnsmasq[50997]: using nameserver 80.190.187.210#53
Feb 11 12:49:11 dnsmasq[50997]: using nameserver 8.8.8.8#53
Feb 11 12:49:11 dnsmasq[50997]: using nameserver 2.2.2.2#53
Feb 11 12:49:11 dnsmasq[50997]: using nameserver 212.6.64.162#53
Feb 11 12:49:11 dnsmasq[50997]: ignoring nameserver 127.0.0.1 - local interface
Feb 11 12:49:11 dnsmasq[50997]: reading /etc/resolv.conf
Feb 11 12:49:11 dnsmasq[50997]: DNS service limited to local subnets
Feb 11 12:49:11 dnsmasq[50997]: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth DNSSEC loop-detect no-inotify
Feb 11 12:49:11 dnsmasq[50997]: started, version 2.76 cachesize 10000
Feb 11 12:49:10 dnsmasq[40360]: exiting on receipt of SIGTERM
Feb 11 12:45:25 dnsmasq[40360]: read /var/etc/dnsmasq-hosts - 28 addresses
Feb 11 12:45:25 dnsmasq[40360]: read /etc/hosts - 2 addresses
Feb 11 12:45:25 dnsmasq[40360]: read /var/etc/dnsmasq-hosts - 24 addresses
Feb 11 12:45:25 dnsmasq[40360]: read /etc/hosts - 2 addresses
Feb 11 12:45:25 dnsmasq[40360]: using nameserver 80.190.187.210#53
Feb 11 12:45:25 dnsmasq[40360]: using nameserver 8.8.8.8#53
Feb 11 12:45:25 dnsmasq[40360]: using nameserver 2.2.2.2#53
Feb 11 12:45:25 dnsmasq[40360]: using nameserver 212.6.64.162#53
Feb 11 12:45:25 dnsmasq[40360]: ignoring nameserver 127.0.0.1 - local interface
Feb 11 12:45:25 dnsmasq[40360]: reading /etc/resolv.conf
Feb 11 12:45:25 dnsmasq[40360]: DNS service limited to local subnets
Feb 11 12:45:25 dnsmasq[40360]: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth DNSSEC loop-detect no-inotify
Feb 11 12:45:25 dnsmasq[40360]: started, version 2.76 cachesize 10000
Feb 11 12:45:25 dnsmasq[9136]: exiting on receipt of SIGTERM
Feb 11 12:40:23 dnsmasq[9136]: read /var/etc/dnsmasq-hosts - 28 addresses
Feb 11 12:40:23 dnsmasq[9136]: read /etc/hosts - 2 addresses


Gut wäre wenn es beim Editieren eines DynDNS Eintrags einen Schalter "Testen" gäbe. Dann wäre es klar ob es nun funktioniert oder eben nicht.

Mir ist nicht klar wann opnSense versucht die DynDNS Einträge zu aktualisieren. Zeitliches Intervall? Oder merkt opnSense wenn sich die WAN-IP ändert?

Grüße
Sörnt

Title: Re: DynDNS - Custom Type
Post by: monstermania on February 12, 2017, 08:03:09 am
Moin,
in das Result-Feld muss man i.d.R. nichts eintragen.
Das brauchst Du höchstens, wenn der DynDns-Dienstanbieter einen sehr exotischen Rückgabewert liefert.  ;)

Zum Update:
Unter System -> Settings -> Cron kann der Updatezyklus des DynDns-Dienstes konfiguriert werden.
Das Logging erfolgt dann in System -> Log File

Gruß
Dirk