OPNsense Forum

Archive => 19.7 Legacy Series => Topic started by: nwesterhausen on October 17, 2019, 10:37:18 pm

Title: Dynamic DNS not working for interfaces besides WAN (IPv4 only)
Post by: nwesterhausen on October 17, 2019, 10:37:18 pm
I've run into an issue and searching has brought me to a couple others with similar but not exact the same issue.

https://forum.opnsense.org/index.php?topic=5692.0 - Multi-wan dyndns, resolved
https://forum.opnsense.org/index.php?topic=7279.0 - Multi-wan dyndns, OP never returned

However in my case, I have an OPT interface I want to use for the dyndns update. When I set it up to be sent, my WAN IP is what gets sent. Even when I set up a LAN interface for dyndns update, if it is for IPv4, it sets it to my WAN IPv4 address. However, when I tried the LAN with IPv6, it correctly put the LAN IPv6 address.

Here are verbose logs from running the update on the OPT2 (zerotier interface) and LAN (IPv4 first, IPv6 second). They are in reverse order from copying them from the web gui:

Code: [Select]
Oct 17 16:21:11 opnsense: /services_dyndns_edit.php: Dynamic DNS: (Success) lan.nw.....nk updated to 68.44.225.XXX
Oct 17 16:21:11 opnsense: /services_dyndns_edit.php: Dynamic DNS: updating cache file /var/cache/dyndns_lan_lan.nw.....nk_5.cache: 68.44.225.XXX
Oct 17 16:21:11 opnsense: /services_dyndns_edit.php: Dynamic DNS (lan.nw.....nk): 68.44.225.XXX extracted
Oct 17 16:21:11 opnsense: /services_dyndns_edit.php: Dynamic DNS (lan.nw.....nk): Current Service: cloudflare
Oct 17 16:21:11 opnsense: /services_dyndns_edit.php: Dynamic DNS (lan.nw.....nk): _checkStatus() starting.
Oct 17 16:21:11 opnsense: /services_dyndns_edit.php: Dynamic DNS (lan.nw.....nk via CloudFlare): _update() starting.
Oct 17 16:21:11 opnsense: /services_dyndns_edit.php: Dynamic DNS (lan.nw.....nk): running dyndns_failover_interface for lan. found ix0
Oct 17 16:21:11 opnsense: /services_dyndns_edit.php: Dynamic DNS (lan.nw.....nk): 68.44.225.XXX extracted
Oct 17 16:21:11 opnsense: /services_dyndns_edit.php: Dynamic DNS: updatedns() starting
Oct 17 16:20:19 opnsense: /services_dyndns_edit.php: Dynamic DNS: (Success) zt1.nw.....nk updated to 68.44.225.XXX
Oct 17 16:20:19 opnsense: /services_dyndns_edit.php: Dynamic DNS: updating cache file /var/cache/dyndns_opt2_zt1.nw.....nk_2.cache: 68.44.225.XXX
Oct 17 16:20:19 opnsense: /services_dyndns_edit.php: Dynamic DNS (zt1.nw.....nk): 68.44.225.XXX extracted
Oct 17 16:20:18 opnsense: /services_dyndns_edit.php: Dynamic DNS (zt1.nw.....nk): Current Service: cloudflare
Oct 17 16:20:18 opnsense: /services_dyndns_edit.php: Dynamic DNS (zt1.nw.....nk): _checkStatus() starting.
Oct 17 16:20:17 opnsense: /services_dyndns_edit.php: Dynamic DNS (zt1.nw.....nk via CloudFlare): _update() starting.
Oct 17 16:20:17 opnsense: /services_dyndns_edit.php: Dynamic DNS (zt1.nw.....nk): running dyndns_failover_interface for opt2. found zta1ivkmol7ho8u
Oct 17 16:20:17 opnsense: /services_dyndns_edit.php: Dynamic DNS (zt1.nw.....nk): 68.44.225.XXX extracted
Oct 17 16:20:17 opnsense: /services_dyndns_edit.php: Dynamic DNS: updatedns() starting


Oct 17 16:25:46 opnsense: /services_dyndns_edit.php: Dynamic DNS: (Success) lan.nw.....nk updated to 2601:800:c001:6d0c:21b:21ff:XXXX:XXXX
Oct 17 16:25:46 opnsense: /services_dyndns_edit.php: Dynamic DNS: updating cache file /var/cache/dyndns_lan_lan.nw.....nk_6_v6.cache: 2601:800:c001:6d0c:21b:21ff:XXXX:XXXX
Oct 17 16:25:46 opnsense: /services_dyndns_edit.php: Dynamic DNS (lan.nw.....nk): 2601:800:c001:6d0c:21b:21ff:XXXX:XXXX extracted
Oct 17 16:25:46 opnsense: /services_dyndns_edit.php: Dynamic DNS (lan.nw.....nk): Current Service: cloudflare-v6
Oct 17 16:25:46 opnsense: /services_dyndns_edit.php: Dynamic DNS (lan.nw.....nk): _checkStatus() starting.
Oct 17 16:25:45 opnsense: /services_dyndns_edit.php: Dynamic DNS (lan.nw.....nk via CloudFlare (v6)): _update() starting.
Oct 17 16:25:45 opnsense: /services_dyndns_edit.php: Dynamic DNS (lan.nw.....nk): running dyndns_failover_interface for lan. found ix0
Oct 17 16:25:45 opnsense: /services_dyndns_edit.php: Dynamic DNS (lan.nw.....nk): 2601:800:c001:6d0c:21b:21ff:XXXX:XXXX extracted
Oct 17 16:25:45 opnsense: /services_dyndns_edit.php: Dynamic DNS: updatedns() starting
Oct 17 16:25:37 opnsense: /services_dyndns_edit.php: Dynamic DNS: (Success) lan.nw.....nk updated to 2601:800:c001:6d0c:21b:21ff:XXXX:XXXX
Oct 17 16:25:37 opnsense: /services_dyndns_edit.php: Dynamic DNS: updating cache file /var/cache/dyndns_lan_lan.nw.....nk_6_v6.cache: 2601:800:c001:6d0c:21b:21ff:XXXX:XXXX

Attached Image of configuration for the OPT2 interface (which is called ZT1) and the general list of dyndns domains.



Edit: Didn't include information about my system.

OPNsense 19.7.5_5-amd64
FreeBSD 11.2-RELEASE-p14-HBSD
LibreSSL 2.9.2
Title: Re: Dynamic DNS not working for interfaces besides WAN (IPv4 only)
Post by: AC on October 23, 2019, 08:32:55 am
Same to me. I have 3 DSL connections. But now my Provider told me that he cuts one of them off. Like always, it's the connection I'm hosting most services like my VPN's...

Now I wanted to use Dynamic DNS so that my VPN devices would connect to a DNS Name rather than directly to an IP. So I can change the connections behind hosted services by just changing the ip at my DNS Provider. Well... the Firewall could do that, but doesn't..
Title: Re: Dynamic DNS not working for interfaces besides WAN (IPv4 only)
Post by: nwesterhausen on October 23, 2019, 03:03:50 pm
So after looking through the plugin code and looking at the get_dyndns_ip function, I determined the goal for the dynamic DNS plugin is only to report what public IP address is returned from http://checkip.dyndns.org.

So for the case of my zerotier IP address, I will manually add DNS for it since I was trying to use the dynamic dns plugin for what it wasn't intended to do (i.e. it wasn't designed to add DNS entries for the address on the interface, only the address perceived from outside the network).

Maybe there's room to add a checkbox "Use interface IP Address" and to allow it to work in the way I expected it to.