Closed pkoenig10 closed 1 year ago
Ah, thanks for this. I haven't given the empty string / self case much consideration yet. Some DNS providers expect/require a @
whereas others use empty string. We should probably figure out which convention is best for libdns to use and go with that.
Do you have a preference/opinion/thoughts on whether @ or "" should be used?
Maybe we should call libdns.AbsoluteName()
in here and then TrimSuffix the .
, I dunno.
I don't have a strong opinion. If it was up to me, I'd probably just use the empty string, for couple reasons:
@
isn't part of the DNS record, it's just a convention that some providers/clients use)Whatever we decide, the value in the Caddy config should probably match the behavior of libdns. So if we change to use the empty string, this has the potential to break existing configurations which use @
.
It also feels reasonable to me to just accept both values, like libdns.AbsoluteName
.
Maybe we should call
libdns.AbsoluteName()
in here and then TrimSuffix the.
This sounds reasonable to me.
Awesome. Thank you both!!
When using the Cloudflare DNS provider, the current IPs are not detected correctly.
The name in the Caddy config is
@
, but the name in the returnedRecord
is the empty string. So we insert intorecMap
using.example.com
, but lookup usingexample.com
.The
libdns
documentation isn't clear on the expected behavior ofRecord.Name
for A records. If the empty string is a valid value for A records, then this PR is the correct fix. But if the value for A records should always be@
, then this should be fixed in libdns/cloudflare.I assume this is the correct fix since it matches similar code in libdns.