Dynamic DNS module - Question about domain configuration

1. The problem I’m having:

Hello :smile:

I have a question regarding caddy-dynamicdns configuration scheme.

I am asking this because I want to integrate this functionality into the OPNsense plugin that I’m maintaining. I use jinja2 template logic for generating the Caddyfile.

If Option3 would work, it would keep my added template logic very lean. The other options require more effort. That’s why I want to make sure beforehand that I follow the proper supported configuration scheme.

Thank you~

2. Error messages and/or full log output:

I don't have any errors.

3. Caddy version:

4. How I installed and ran Caddy:

a. System environment:

b. Command:

c. Service/unit/compose file:

For 3. and 4. its the same configuration as in this thread.

d. My complete Caddy config:

As an example, there are 3 domains:

example.com
sub.example.com
sub2.example.com
  1. Option
{
	dynamic_dns {
		provider cloudflare {env.CLOUDFLARE_API_TOKEN}
		domains {
			example.com @ sub sub2
		}
	}
}
  1. Option
{
	dynamic_dns {
		provider cloudflare {env.CLOUDFLARE_API_TOKEN}
		domains {
            example.com @ 
            example.com sub 
            example.com sub2
		}
	}
}
  1. Option
{
	dynamic_dns {
		provider cloudflare {env.CLOUDFLARE_API_TOKEN}
		domains {
            example.com 
            sub.example.com
            sub2.example.com
		}
	}
}

5. Links to relevant resources:

Pretty sure it’s option 1 and 2 that could work, not 3.

The plugin needs to know the correct zone to use (i.e. base domain) so that’s why it’s split like that.

1 Like

Thanks a lot for the clarification. :muscle:

I have one more question, I have tested the setup with the ip_source interface option.

Caddyfile:

{
        storage file_system {
                root /usr/local/etc/caddy
        }
        log {
                output net unixgram//var/caddy/var/run/log {
                }
                format json {
                        time_format rfc3339
                }
        }

        servers {
                trusted_proxies static 192.168.1.1/32
                log_credentials
        }

        dynamic_dns {
                provider cloudflare sfdfsdfsdfs
                domains {
                        example.net @
                }
                ip_source interface hn1
                check_interval 5m
                ttl 1h
        }

        import /usr/local/etc/caddy/caddy.d/*.global
}

example.net {
        abort
}

Here is the configuration of the hn1 interface:

hn1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        description: WAN (wan)
        options=80018<VLAN_MTU,VLAN_HWTAGGING,LINKSTATE>
        ether 00:15:5d:00:c9:8c
        inet 172.16.0.199 netmask 0xffffff00 broadcast 172.16.0.255
        inet6 fe80::215:5dff:fe00:c98c%hn1 prefixlen 64 scopeid 0x6
        inet6 2003:a:1704:63aa:215:5dff:fe00:c98c prefixlen 64 autoconf
        media: Ethernet autoselect (10Gbase-T <full-duplex>)
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

I have logged the result:

2024-01-11T21:05:46	Informational	caddy	"info","ts":"2024-01-11T21:05:46Z","logger":"dynamic_dns","msg":"updating DNS record","zone":"example.net","type":"AAAA","name":"@","value":"2003:a:1704:63aa:215:5dff:fe00:c98c","ttl":3600}	
2024-01-11T21:05:46	Informational	caddy	"info","ts":"2024-01-11T21:05:46Z","logger":"dynamic_dns","msg":"updating DNS record","zone":"example.net","type":"AAAA","name":"@","value":"fe80::215:5dff:fe00:c98c","ttl":3600}	
2024-01-11T21:05:46	Informational	caddy	"info","ts":"2024-01-11T21:05:46Z","logger":"dynamic_dns","msg":"updating DNS record","zone":"example.net","type":"A","name":"@","value":"172.16.0.199","ttl":3600}

It reads the IPv6 Global Unicast Address from the hn1 interface and tries to set an AAAA record, awesome.

Then it tries to set the IPv6 Link Local Address as AAAA record. It would probably set a IPv6 Unique Local Address as AAAA record too. Also, it tries to set an RFC1918 IPv4 address as A record.

I’d like to know in which scope this is.

  • Would a DNS provider skip these requests as invalid?
  • Should the dynamic-dns module skip non-GUA and non-RFC1918 addresses it reads from interfaces?
  • Maybe the problem is me? :slight_smile: Did I configure something wrong?

Thanks a lot for any insight :slight_smile:

:man_shrugging:

I don’t use IPv6 (my ISP doesn’t support it, still :sweat:) and don’t play with network interfaces much, so I don’t know how to answer this.

If you think there’s a bug, best to open an issue on the repo.

Thanks for your answer,

I’m sad you don’t have IPv6 yet, its awesome. Hope your ISP will provide it soon for you.

I will open a report in the repository after conducting some more testing with how the plugin behaves with dual stack configurations of interfaces.

I just wanted to make sure if it’s a quick yes or no thing before going to github with it. :+1:

lol.

Nop.

Bell in Canada is a joke.

There’s even a joke twitter account about it. https://twitter.com/bellnoipv6

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.