API ddns ipv6

I used linode-cli as a ddns.
i used the command "linode-cli domains records-update --type A --target [remote_addr] $DID $RID"

With my ISP is update correcty.
Then i used a openvpn tunnel with ipv6 and updates with a AAAA record.

went i come back with my ISP i got this error:

Request failed: 400
field reason
type type is not an editable field.

same with curl.

4 Replies

Linode Staff

Hey there,

Just so any confusion is avoided from the start, I want to clarify that I tried replicating the error message you described using the new linode CLI. I mention it because I looked at your command syntax and it seems you were using the old CLI.

With that now out of the way, I want to say that I tried several configurations and even though I did get some unexpected results, I couldn’t get the same error you got. Here’s what I tried:

From my local computer (Mac), modify hostname www A record :

$linode domain record-update <domain zone> --type A --target [remote_addr] --match www

[remote_addr] places the IP of the request as the target. Thus, it ended up setting my www A record to my public IP. If I understood correctly, this also worked for you without any issues.

Since I don’t have an IPv6 address, I created a test Linode which gets an IPv6 address by default.

From my test Linode (Ubuntu 18.04 and Fedora 28), try to modify my www AAAA record:

$linode domain record-update <domain zone> --type AAAA --target [remote_addr] --match www

This worked ok since my www AAAA record was changed to the Linode’s IPv6 address.

The unexpected part, at least for me, was when I tried changing my www A record from the Linode:

$linode domain record-update <domain zone> --type A --target [remote_addr] --match www

My A record ended up being replaced by a AAAA record with the IPv6 address of the Linode. Apparently the request is still made using IPv6, even though the type I specified was A. I guess the request IP trumps all settings.

By the way, a very quick way to view the DNS records for a Domain Zone using the CLI is:

$linode domain record-list --label <domain zone>

My theory of what happened to you is that [remote_addr], plus the $DID and $RID in the old CLI is triggering a bug in the old API. This might not be an issue anymore in our current API(v4) which is what the updated CLI uses. For this reason, I would suggest trying to install the new CLI and going through the same process again to see if you get the same error. I'll give you a guide that you can easily reference if you want more information about the new CLI:

https://www.linode.com/docs/platform/api/linode-cli/

I hope this ends up working out for you but if it doesn't or you have any more questions just let us know.

Regards,

Elias

i used the github to install linode-cli

i just confirm in th irc of linode

that [remote_addr] change the record type.

So instead i will use curl to update the domain refer here.

https://developers.linode.com/api/v4#operation/updateDomainRecord

Linode Staff

Well… This is akward. After further digging and testing, it turns out I was the one using the old version of the client. I apologize for the confusion. I can see that you are very aware of the new API and client, but it wouldn't hurt to point out the updated guide in our docs regarding the client.

https://www.linode.com/docs/platform/api/using-the-linode-cli/

With this client I was able to reproduce the error. What follows is what I went through to reproduce it:

Original record list:

[root@li1099-113 ~]# linode-cli domains records-list 1146471
┌──────────┬──────┬──────┬────────────────────────────────┬─────────┬──────────┬────────┐
│ id       │ type │ name │ target                         │ ttl_sec │ priority │ weight │
├──────────┼──────┼──────┼────────────────────────────────┼─────────┼──────────┼────────┤
│ 11235932 │ A    │      │ 50.116.22.203                  │ 0       │ 10       │ 5      │
│ 11235935 │ AAAA │      │ 2600:3c00::f03c:91ff:febe:a52a │ 0       │ 10       │ 5      │
│ 11235938 │ MX   │      │ mail.eliasvaldez.com           │ 0       │ 10       │ 5      │
│ 11235934 │ A    │ mail │ 50.116.22.203                  │ 0       │ 10       │ 5      │
│ 11235937 │ AAAA │ mail │ 2600:3c00::f03c:91ff:febe:a52a │ 0       │ 10       │ 5      │
│ 11235933 │ A    │ www  │ 50.116.22.203                  │ 0       │ 10       │ 5      │
│ 11235936 │ AAAA │ www  │ 2600:3c00::f03c:91ff:febe:a52a │ 0       │ 10       │ 5      │
└──────────┴──────┴──────┴────────────────────────────────┴─────────┴──────────┴────────┘

Changing record 11235933, which is a type A record resulted in this:

root@localhost:~# linode-cli domains records-update --type A --target [remote_addr] 1146471 11235933
┌──────────┬──────┬──────┬────────────────────────────────┬─────────┬──────────┬────────┐
│ id       │ type │ name │ target                         │ ttl_sec │ priority │ weight │
├──────────┼──────┼──────┼────────────────────────────────┼─────────┼──────────┼────────┤
│ 11235933 │ AAAA │ www  │ 2600:3c03::f03c:91ff:febe:a5bf │ 0       │ 10       │ 5      │
└──────────┴──────┴──────┴────────────────────────────────┴─────────┴──────────┴────────┘

As you mentioned, the record type was changed to a AAAA type record, which can be further verified in:

[root@li1099-113 ~]# linode-cli domains records-list 1146471
┌──────────┬──────┬──────┬────────────────────────────────┬─────────┬──────────┬────────┐
│ id       │ type │ name │ target                         │ ttl_sec │ priority │ weight │
├──────────┼──────┼──────┼────────────────────────────────┼─────────┼──────────┼────────┤
│ 11235932 │ A    │      │ 50.116.22.203                  │ 0       │ 10       │ 5      │
│ 11235935 │ AAAA │      │ 2600:3c00::f03c:91ff:febe:a52a │ 0       │ 10       │ 5      │
│ 11235938 │ MX   │      │ mail.eliasvaldez.com           │ 0       │ 10       │ 5      │
│ 11235934 │ A    │ mail │ 50.116.22.203                  │ 0       │ 10       │ 5      │
│ 11235937 │ AAAA │ mail │ 2600:3c00::f03c:91ff:febe:a52a │ 0       │ 10       │ 5      │
│ 11235933 │ AAAA │ www  │ 2600:3c03::f03c:91ff:febe:a5bf │ 0       │ 10       │ 5      │
│ 11235936 │ AAAA │ www  │ 2600:3c00::f03c:91ff:febe:a52a │ 0       │ 10       │ 5      │
└──────────┴──────┴──────┴────────────────────────────────┴─────────┴──────────┴────────┘

If you try to update the record again with the same command, it will fail since the record type changed. This is the error message you described in your initial post:

root@localhost:~# linode-cli domains records-update --type A --target [remote_addr] 1146471 11235933
Request failed: 400
┌errors─┬────────────────────────────────┐
│ field │ reason                         │
├───────┼────────────────────────────────┤
│ type  │ type is not an editable field. │
└───────┴────────────────────────────────┘

Since the IP address of the request is king, as long as you specify the current record type, the command will execute without problems. So:

root@localhost:~# linode-cli domains records-update --type AAAA --target [remote_addr] 1146471 11235933

Will change back the record type to A if you make the request from a machine that makes an IPv4 request.

Regards,

Elias

Thanks i solve it with a if-else shell script with linode-cli.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct